37 lines
965 B
TypeScript
37 lines
965 B
TypeScript
import {
|
|
httpDeleteInterceptor,
|
|
httpGetInterceptor,
|
|
httpPostInterceptor,
|
|
} from "../http-config/http-interceptor-service";
|
|
|
|
export async function listContest(title: string = "", size: any, page: number) {
|
|
return await httpGetInterceptor(
|
|
`contest/pagination?enablePage=1&size=${size}&page=${page}&title=${title}`
|
|
);
|
|
}
|
|
|
|
export async function createTask(data: any) {
|
|
const url = "assignment";
|
|
return httpPostInterceptor(url, data);
|
|
}
|
|
|
|
export async function getContestById(id: any, pages = 0) {
|
|
const url = `contest?id=${id}&page=${pages}`;
|
|
return httpGetInterceptor(url);
|
|
}
|
|
|
|
export async function postCreateContest(data: any) {
|
|
const url = "contest";
|
|
return httpPostInterceptor(url, data);
|
|
}
|
|
|
|
export async function publishContest(id: any) {
|
|
const url = `contest/publish?id=${id}`;
|
|
return httpPostInterceptor(url);
|
|
}
|
|
|
|
export async function deleteContest(id: any) {
|
|
const url = `contest?id=${id}`;
|
|
return httpDeleteInterceptor(url);
|
|
}
|