mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
20 lines
561 B
TypeScript
20 lines
561 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>(`/competition/${id}`);
|
|
};
|
|
|
|
export const startCompetition = async (competitionId: string) => {
|
|
return await userFetch(`/competitions/${competitionId}/start`, {
|
|
method: 'POST'
|
|
});
|
|
}; |