This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
atsebay.t/ui/src/lib/gradation.js

20 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);
}
}