mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 05:07:10 +00:00
21 lines
564 B
TypeScript
21 lines
564 B
TypeScript
import { userFetch } from ".";
|
|
import { Competition } from "../types/competition";
|
|
|
|
export const getCompetitions = async (participating?: boolean) => {
|
|
return await userFetch<Competition[]>("/competitions", {
|
|
params: {
|
|
is_participating: participating,
|
|
},
|
|
});
|
|
};
|
|
|
|
export const getCompetition = async (id: string) => {
|
|
return await userFetch<Competition>(`/competitions/${id}`);
|
|
};
|
|
|
|
export const startCompetition = async (competitionId: string) => {
|
|
return await userFetch(`/competitions/${competitionId}/start`, {
|
|
method: "POST",
|
|
});
|
|
};
|