2024-12-05 17:02:06 +00:00
|
|
|
import {
|
2025-06-24 08:19:46 +00:00
|
|
|
httpDeleteInterceptor,
|
2024-12-05 17:02:06 +00:00
|
|
|
httpGetInterceptor,
|
|
|
|
|
httpPostInterceptor,
|
|
|
|
|
} from "../http-config/http-interceptor-service";
|
|
|
|
|
|
2025-04-03 15:43:04 +00:00
|
|
|
export async function listContest(title: string = "", size: any, page: number) {
|
2024-12-05 17:02:06 +00:00
|
|
|
return await httpGetInterceptor(
|
2024-12-12 13:04:27 +00:00
|
|
|
`contest/pagination?enablePage=1&size=${size}&page=${page}&title=${title}`
|
2024-12-05 17:02:06 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function createTask(data: any) {
|
|
|
|
|
const url = "assignment";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
2024-12-18 19:03:22 +00:00
|
|
|
|
|
|
|
|
export async function getContestById(id: any, pages = 0) {
|
|
|
|
|
const url = `contest?id=${id}&page=${pages}`;
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpGetInterceptor(url);
|
2024-12-18 19:03:22 +00:00
|
|
|
}
|
2025-01-06 14:06:02 +00:00
|
|
|
|
|
|
|
|
export async function postCreateContest(data: any) {
|
|
|
|
|
const url = "contest";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
2025-02-23 16:26:35 +00:00
|
|
|
|
|
|
|
|
export async function publishContest(id: any) {
|
|
|
|
|
const url = `contest/publish?id=${id}`;
|
|
|
|
|
return httpPostInterceptor(url);
|
|
|
|
|
}
|
2025-06-24 08:19:46 +00:00
|
|
|
|
|
|
|
|
export async function deleteContest(id: any) {
|
|
|
|
|
const url = `contest?id=${id}`;
|
|
|
|
|
return httpDeleteInterceptor(url);
|
|
|
|
|
}
|