- // if(nulledCategories.length > 0) {
- // remove = $.ajax({
- // // url: apiUrl('api/config/default-severity'),
- // url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')),
- // type: 'DELETE',
- // beforeSend: Utils.addAuthorizationStub,
- // success: function(data) {
- // resolve(data);
- // },
- // error: function(error) {
- // console.log("There was an error updating the logging config data",
- // error);
- // reject(error);
- // }
- // });
- // promises.push(remove);
- // }
+ if(loggingConfig.hasOwnProperty('allowDuplicateEvents')) {
+ promises.push($.ajax({
+ url: apiUrl('api/config/allow-duplicate-events'),
+ type: 'PUT',
+ beforeSend: Utils.addAuthorizationStub,
+ data: {
+ allowDuplicateEvents: loggingConfig.allowDuplicateEvents
+ },
+ success: function(data) {
+ if (!loggingConfig.allowDuplicateEvents) {
+ delete state.loggingConfig.allowDuplicateEvents
+ }
+ resolve(data);
+ },
+ error: function(error) {
+ console.log("There was an error updating the logging config data",
+ error);
+ reject(error);
+ }
+ }))
+ }
+ if(nulledCategories.length > 0) {
+ remove = $.ajax({
+ // url: apiUrl('api/config/default-severity'),
+ url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')),
+ type: 'DELETE',
+ beforeSend: Utils.addAuthorizationStub,
+ success: function(data) {
+ resolve(data);
+ },
+ error: function(error) {
+ console.log("There was an error updating the logging config data",
+ error);
+ reject(error);
+ }
+ });
+ promises.push(remove);
+ }