admin: Display student needing help on home page

This commit is contained in:
nemunaire 2022-05-01 11:18:08 +02:00
commit 0cb07a70c4
3 changed files with 54 additions and 0 deletions

View file

@ -51,6 +51,15 @@ export async function getUserScore(uid, survey) {
}
}
export async function getUserNeedingHelp() {
const res = await fetch(`api/help`, {headers: {'Accept': 'application/json'}})
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}
export async function getScore(survey) {
const res = await fetch(`api/surveys/${survey.id}/score`, {headers: {'Accept': 'application/json'}})
if (res.status == 200) {