Add a new page to list repos and submissions
This commit is contained in:
parent
643e4d50bd
commit
6323d96b60
12 changed files with 167 additions and 33 deletions
|
|
@ -7,8 +7,11 @@ export async function getPromos() {
|
|||
}
|
||||
}
|
||||
|
||||
export async function getUsers() {
|
||||
const res = await fetch('api/users', {headers: {'Accept': 'application/json'}})
|
||||
export async function getUsers(promo, group) {
|
||||
let url = '/api/users?';
|
||||
if (promo) url += "promo=" + encodeURIComponent(promo) + "&";
|
||||
if (group) url += "group=" + encodeURIComponent(group) + "&";
|
||||
const res = await fetch(url, {headers: {'Accept': 'application/json'}})
|
||||
if (res.status == 200) {
|
||||
return await res.json();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ export class Work {
|
|||
}
|
||||
}
|
||||
|
||||
async getSubmission() {
|
||||
const res = await fetch(`api/works/${this.id}/submission`, {
|
||||
async getSubmission(uid) {
|
||||
const res = await fetch(uid?`api/users/${uid}/works/${this.id}/submission`:`api/works/${this.id}/submission`, {
|
||||
headers: {'Accept': 'application/json'}
|
||||
});
|
||||
if (res.status == 200) {
|
||||
|
|
|
|||
Reference in a new issue