added try catch on create and edit downtime

pull/1097/head
smit95tpatel 2021-12-28 18:36:41 +05:30
parent 0647060031
commit 1b4966c533
1 changed files with 11 additions and 5 deletions

View File

@ -300,12 +300,18 @@ export default {
};
this.isLoading=true;
if (id) {
await Api.downtime_update({ id, data: downtime });
} else {
await Api.downtime_create(downtime);
try {
if (id) {
await Api.downtime_update({ id, data: downtime });
} else {
await Api.downtime_create(downtime);
}
this.isLoading=false;
} catch (error) {
this.isLoading=false;
throw new Error('error.message');
}
this.isLoading=false;
this.$router.push('/dashboard/downtimes');
},