Fetch gradation status

This commit is contained in:
nemunaire 2023-03-06 13:31:24 +01:00
commit 018ed9227f
3 changed files with 75 additions and 7 deletions

View file

@ -40,4 +40,16 @@ export class Grade {
throw new Error((await res.json()).errmsg);
}
}
async gradationStatus() {
const res = await fetch(this.id_user?`api/users/${this.id_user}/works/${this.id_work}/grades/${this.id}/status`:`api/works/${this.id_work}/grades/${this.id}/status`, {
method: 'GET',
headers: {'Accept': 'application/json'},
});
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}
}