New route to test routine
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
parent
e1f5fbcd6c
commit
d202cdfee8
3 changed files with 28 additions and 0 deletions
|
|
@ -26,6 +26,18 @@ export class Routine {
|
|||
}
|
||||
}
|
||||
|
||||
async launch() {
|
||||
const res = await fetch(`api/routines/${this.id}/run`, {
|
||||
method: 'POST',
|
||||
headers: {'Accept': 'application/json'}
|
||||
});
|
||||
if (res.status == 200) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error((await res.json()).errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
async save() {
|
||||
const res = await fetch(this.id?`api/routines/${this.id}`:'api/routines', {
|
||||
method: this.id?'PUT':'POST',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue