Do grading page

This commit is contained in:
nemunaire 2022-02-21 14:59:27 +01:00
commit df2da4221e
2 changed files with 77 additions and 17 deletions

View file

@ -25,6 +25,14 @@ export async function getUser(uid) {
}
}
export async function getGrades(uid, survey) {
const res = await fetch(`api/grades`, {headers: {'Accept': 'application/json'}})
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}
export async function getUserGrade(uid, survey) {
const res = await fetch(`api/users/${uid}/surveys/${survey.id}/grades`, {headers: {'Accept': 'application/json'}})
if (res.status == 200) {