mirror of https://github.com/statping/statping
added try catch on create and edit downtime
parent
0647060031
commit
1b4966c533
|
|
@ -300,12 +300,18 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.isLoading=true;
|
this.isLoading=true;
|
||||||
if (id) {
|
|
||||||
await Api.downtime_update({ id, data: downtime });
|
try {
|
||||||
} else {
|
if (id) {
|
||||||
await Api.downtime_create(downtime);
|
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');
|
this.$router.push('/dashboard/downtimes');
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue