update Mi 27. Mai 11:01:01 CEST 2020

This commit is contained in:
Robert Richter 2020-05-27 11:01:01 +02:00
parent 39d5ebf101
commit 9130b6f4b0
2 changed files with 19 additions and 5 deletions

View File

@ -46,7 +46,12 @@ module.exports = function (io, sql, app_cfg, waip) {
// Socket.IO Sende-API (Daten an Server senden, die Verbindung hergestellt haben)
if (app_cfg.endpoint.enabled) {
/*if (app_cfg.endpoint.enabled) {
} else {
const remote_api;
};*/
var remote_api = io_api.connect(app_cfg.endpoint.host, {
reconnect: true
});
@ -70,9 +75,18 @@ module.exports = function (io, sql, app_cfg, waip) {
remote_api.emit('new_rmld', data);
// gibts nur im routing
} else {
const remote_api;
};
function db_get_waipid_by_uuid(waip_uuid, callback) {
db.get(`SELECT id FROM WAIP_EINSAETZE WHERE uuid like ?`, [waip_uuid], function (err, row) {
if (err == null && row) {
callback && callback(row.id);
} else {
callback && callback(null);
};
});
};

View File

@ -2,7 +2,7 @@ module.exports = function (io, sql, brk, async, app_cfg) {
// Einsatzmeldung in Datenbank speichern
function einsatz_speichern(einsatz_rohdaten) {
// TODO: Einsatzdaten auf Validität prüfen
// FIXME: Einsatzdaten auf Validität prüfen
// Einsatzmeldung (JSON) speichern
sql.db_einsatz_speichern(einsatz_rohdaten, function (waip_id) {
sql.db_log('WAIP', 'DEBUG: Neuer Einsatz mit der ID ' + waip_id);