New route to delete grades

This commit is contained in:
nemunaire 2023-03-05 13:17:25 +01:00
commit 706e786190
5 changed files with 107 additions and 5 deletions

View file

@ -1,3 +1,5 @@
import { Grade } from '$lib/grades';
export class Work {
constructor(res) {
this.kind = "w";
@ -110,7 +112,7 @@ export class Work {
headers: {'Accept': 'application/json'},
});
if (res.status == 200) {
return await res.json();
return (await res.json()).map((g) => new Grade(g));
} else {
throw new Error((await res.json()).errmsg);
}