X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flogging%2Fapi%2Flogging.js;h=3ef9027d9e359e446cc20a4aaa35775c539b96a8;hb=1ba13dc55553983a3ec6f88cf426e3c30b53a455;hp=c2f56f834f45f65c73ba5ac6ad3357ce7a102be7;hpb=660c2a10bd46b81968e3ed354ea4b3f218c90b29;p=osm%2FUI.git diff --git a/skyquake/plugins/logging/api/logging.js b/skyquake/plugins/logging/api/logging.js index c2f56f834..3ef9027d9 100644 --- a/skyquake/plugins/logging/api/logging.js +++ b/skyquake/plugins/logging/api/logging.js @@ -369,15 +369,14 @@ Config.deleteDefaultSyslogSeverity = function(req) { Config.setAllowDuplicateEvents = function(req) { // TODO: verify there is one key at root of data: 'default-severity' // OR just filter on the request body - - if (req.body.hasOwnProperty('allowDuplicateEvents') && - typeof req.body.allowDuplicateEvents == 'boolean') { - if (req.body.allowDuplicateEvents) { - return handlePutRequest(req, APIVersion + '/api/config/logging/allow', { +console.log(req.body) + if (req.body.hasOwnProperty('allowDuplicateEvents')) { + if (req.body.allowDuplicateEvents.toUpperCase() == "TRUE") { + return handlePutRequest(req, '/api/config/logging/allow', { "duplicate": "events" }); } else { // false, remove entry from logging config - return handleDeleteRequest(req, APIVersion + '/api/config/logging/allow/duplicate'); + return handleDeleteRequest(req, '/api/config/logging/allow/duplicate'); } } else { return handleReject(statusCode=400,