New route to delete grades
This commit is contained in:
parent
6f9b83ef24
commit
706e786190
5 changed files with 107 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue