RIFT-14916: Code added but commented out for removing cat severity filter
[osm/UI.git] / skyquake / plugins / logging / src / loggingSource.js
index 47e6e48..690d323 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,30 +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);
-          /* Backend bug disallows deleting: RIFT-14910
-          
           if(nulledCategories.length > 0) {
             remove = $.ajax({
               // url: apiUrl('api/config/default-severity'),
-              url: apiUrl('api/config/default-syslog-severity'),
+              url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')),
               type: 'DELETE',
               beforeSend: Utils.addAuthorizationStub,
-              data: nulledCategories,
               success: function(data) {
                 resolve(data);
               },
@@ -101,10 +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)