import {
  httpGetInterceptor,
  httpPostInterceptor,
} from "../http-config/http-interceptor-service";

export async function listContest(
  title: string = "",
  size: number,
  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);
}
