X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flogging%2Fsrc%2FloggingSource.js;h=690d32326b86e354970690c0a0129592d066edd4;hb=refs%2Fchanges%2F53%2F553%2F1;hp=e073809e3b231899c996ca5079494196ef434082;hpb=e29efc315df33d546237e270470916e26df391d6;p=osm%2FUI.git diff --git a/skyquake/plugins/logging/src/loggingSource.js b/skyquake/plugins/logging/src/loggingSource.js index e073809e3..690d32326 100644 --- a/skyquake/plugins/logging/src/loggingSource.js +++ b/skyquake/plugins/logging/src/loggingSource.js @@ -1,5 +1,5 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -66,29 +66,12 @@ export default { return new Promise(function(resolve, reject) { let promises = []; let remove = null; - let change = $.ajax({ - url: apiUrl('api/aggregate'), - type: 'PUT', - beforeSend: Utils.addAuthorizationStub, - data: loggingConfig, - success: function(data) { - resolve(data); - }, - error: function(error) { - console.log("There was an error updating the logging config data", - error); - reject(error); - } - }); - promises.push(change); if(nulledCategories.length > 0) { remove = $.ajax({ - url: apiUrl('api/config/default-severity'), + // url: apiUrl('api/config/default-severity'), + url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')), type: 'DELETE', beforeSend: Utils.addAuthorizationStub, - data: { - 'default-severity' : nulledCategories - }, success: function(data) { resolve(data); }, @@ -100,9 +83,22 @@ export default { }); promises.push(remove); } - - - Promise.all(promises).then(function(data){ + Promise.all(promises).then(function(data) { + return $.ajax({ + url: apiUrl('api/aggregate'), + type: 'PUT', + beforeSend: Utils.addAuthorizationStub, + data: loggingConfig, + success: function(data) { + resolve(data); + }, + error: function(error) { + console.log("There was an error updating the logging config data", + error); + reject(error); + } + }); + }).then(function(data){ resolve(data) }, function(){ reject(arguments)