Retrieve Drone build state

This commit is contained in:
nemunaire 2022-09-05 03:30:10 +02:00
commit 6245e49be7
3 changed files with 55 additions and 3 deletions

View file

@ -25,6 +25,17 @@ export class WorkRepository {
}
}
async getBuildState() {
const res = await fetch(`api/repositories/${this.id}/state`, {
headers: {'Accept': 'application/json'}
});
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}
async retrieveWork() {
const res = await fetch(`api/repositories/${this.id}/trigger`, {
method: 'POST',