This commit is contained in:
parent
632f476092
commit
16d7fe4beb
3 changed files with 9 additions and 3 deletions
|
|
@ -25,7 +25,7 @@
|
|||
{:then keys}
|
||||
{#if keys && keys.length > 0}
|
||||
{#each keys as keyid}
|
||||
{#await getKey(keyid)}
|
||||
{#await getKey(keyid, student.id)}
|
||||
Veuillez patienter
|
||||
{:then key}
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ export async function getKeys(userid) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function getKey(kid) {
|
||||
const res = await fetch(`api/keys/${kid}`, {headers: {'Accept': 'application/json'}})
|
||||
export async function getKey(kid, userid) {
|
||||
const res = await fetch(userid?`api/users/${userid}/keys/${kid}`:`api/keys/${kid}`, {headers: {'Accept': 'application/json'}})
|
||||
if (res.status == 200) {
|
||||
return new Key(await res.json());
|
||||
} else {
|
||||
|
|
|
|||
Reference in a new issue