New route to launch action individually
This commit is contained in:
parent
d202cdfee8
commit
05c87ac7b3
3 changed files with 62 additions and 0 deletions
|
|
@ -25,6 +25,18 @@ export class Action {
|
|||
}
|
||||
}
|
||||
|
||||
async launch() {
|
||||
const res = await fetch(`api/actions/${this.id}/run`, {
|
||||
method: 'POST',
|
||||
headers: {'Accept': 'application/json'}
|
||||
});
|
||||
if (res.status == 200) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error((await res.json()).errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
toggleEnable() {
|
||||
this.enabled = !this.enabled;
|
||||
this.save();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue