Do grading page
This commit is contained in:
parent
e3100e94e5
commit
df2da4221e
2 changed files with 77 additions and 17 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Reference in a new issue