New route to run gradation tests

This commit is contained in:
nemunaire 2023-01-01 21:11:20 +01:00
commit 735a120259
3 changed files with 125 additions and 6 deletions

View file

@ -76,6 +76,18 @@ export class WorkRepository {
}
}
async runGradation() {
const res = await fetch(this.id_work?`api/works/${this.id_work}/repositories/${this.id}/gradation`:`api/repositories/${this.id}/gradation`, {
method: 'POST',
headers: {'Accept': 'application/json'},
});
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}
async save(user) {
let url = this.id?`repositories/${this.id}`:'repositories';