Spaces:
Sleeping
Sleeping
File size: 579 Bytes
a34cccb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import axios from "axios";
const api = axios.create({
baseURL: "/api",
});
export const getRepos = () => api.get("/repos").then(r => r.data);
export const addRepo = (data: { namespace: string; repo: string }) =>
api.post("/repos", data);
export const deleteRepo = (id: string) =>
api.delete(`/repos/${id}`);
export const getMetrics = (repoId: string, range: string) =>
api.get("/metrics", { params: { repoId, range } }).then(r => r.data);
export const getStatus = (repoId: string) =>
api.get("/status", { params: { repoId } }).then(r => r.data); |