This repository has been archived on 2024-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
atsebay.t/ui/src/lib/gradation.js
Pierre-Olivier Mercier 6def3de983
Some checks are pending
continuous-integration/drone/push Build is running
New field added for works to store gradation repository
2023-01-01 15:26:58 +01:00

19 lines
601 B
JavaScript

export async function getGradationRepositories() {
let url = '/api/gradation_repositories';
const res = await fetch(url, {headers: {'Accept': 'application/json'}})
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}
export async function syncGradationRepositories() {
let url = '/api/gradation_repositories/sync';
const res = await fetch(url, {method: 'post', headers: {'Accept': 'application/json'}})
if (res.status == 200) {
return await res.json();
} else {
throw new Error((await res.json()).errmsg);
}
}