fix(ui-144): alert catch the errors on delete

This commit is contained in:
Shekar Siri 2023-12-15 14:06:31 +01:00
parent ce424d0959
commit bb35062dfc

View file

@ -54,15 +54,19 @@ export default class AlertsStore {
});
};
remove = async (id: string) => {
this.loading = true;
try {
await alertsService.remove(id);
} catch (e) {
console.error(e);
} finally {
this.loading = false;
}
remove = (id: string): Promise<void> => {
return new Promise<void>(async (resolve, reject) => {
this.loading = true;
try {
await alertsService.remove(id);
resolve();
} catch (e) {
console.error(e);
reject(e);
} finally {
this.loading = false;
}
});
};
fetchTriggerOptions = async () => {