Skip to content

Commit

Permalink
Merge pull request #5432 from Countly/fix/event-deletion
Browse files Browse the repository at this point in the history
Event deletion fix
  • Loading branch information
kanwarujjaval authored Jul 25, 2024
2 parents e963b83 + 11e7ed0 commit b115748
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
25 changes: 14 additions & 11 deletions plugins/data-manager/frontend/public/javascripts/countly.models.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,17 +452,20 @@
},
deleteEvents: function(context, events) {
countlyDataManager.service.deleteEvents(events).then(function(res) {
countlyDataManager.service.deleteEventsMeta(events).then(function(res2) {
if (res === 'Error' || res2 === 'Error') {
CountlyHelpers.notify({message: CV.i18n('data-manager.error.event-delete'), sticky: false, type: 'error'});
return 'Error';
}
context.dispatch('loadEventsData');
context.dispatch('loadSegmentsMap');
CountlyHelpers.notify({message: CV.i18n('data-manager.success.event-delete'), sticky: false, type: 'success'});
});
}).catch(function() {
CountlyHelpers.notify({message: CV.i18n('data-manager.error.event-delete'), sticky: false, type: 'error'});
if (res === 'Error') {
CountlyHelpers.notify({message: CV.i18n('data-manager.error.event-delete'), sticky: false, type: 'error'});
return 'Error';
}
context.dispatch('loadEventsData');
context.dispatch('loadSegmentsMap');
CountlyHelpers.notify({message: CV.i18n('data-manager.success.event-delete'), sticky: false, type: 'success'});
}).catch(function(e) {
if (e.status === 504) {
CountlyHelpers.notify({message: CV.i18n('data-manager.error.event-delete-timeout'), sticky: false, type: 'warning'});
}
else {
CountlyHelpers.notify({message: CV.i18n('data-manager.error.event-delete'), sticky: false, type: 'error'});
}
});
},
loadCategories: function(context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ data-manager.success.event-update = Event Updated
data-manager.error.event-update = Error while updating event
data-manager.success.event-delete = Event Deleted
data-manager.error.event-delete = Error while deleting event
data-manager.error.event-delete-timeout = Event deletion is in progress. Please wait for a while.
data-manager.success.category-create = Category Created
data-manager.error.category-create = Error while creating category
data-manager.success.category-update = Category Updated
Expand Down

0 comments on commit b115748

Please sign in to comment.