Fetch gradation status
This commit is contained in:
parent
1f7896ff26
commit
018ed9227f
3 changed files with 75 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue