2024-12-04 17:28:40 +00:00
|
|
|
import {
|
|
|
|
|
deleteAPIInterceptor,
|
|
|
|
|
getAPIInterceptor,
|
|
|
|
|
postAPIInterceptor,
|
|
|
|
|
} from "../config/api";
|
2024-12-05 17:02:06 +00:00
|
|
|
import {
|
|
|
|
|
httpGetInterceptor,
|
|
|
|
|
httpPostInterceptor,
|
|
|
|
|
} from "./http-config/http-interceptor-service";
|
2024-12-04 17:28:40 +00:00
|
|
|
|
2024-12-05 17:02:06 +00:00
|
|
|
export async function listTask(size: number, page: number) {
|
|
|
|
|
return await httpGetInterceptor(`assignment/list?size=${size}&page=${page}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function createTask(data: any) {
|
|
|
|
|
const url = "assignment";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
2024-12-04 17:28:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getTask(id: any) {
|
|
|
|
|
const url = `/assignment?id=${id}`;
|
|
|
|
|
return getAPIInterceptor({ url });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function forwardTask(data: any) {
|
|
|
|
|
const url = "assignment/forward";
|
|
|
|
|
return postAPIInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function finishTask(id: any) {
|
|
|
|
|
const url = `assignment/finish?id=${id}`;
|
|
|
|
|
return postAPIInterceptor(url, id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function deleteTask(id: any) {
|
|
|
|
|
const url = `assignment?id=${id}`;
|
|
|
|
|
return deleteAPIInterceptor(url, id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getUserLevelForAssignments() {
|
|
|
|
|
const url = "/users/user-levels/assignment";
|
|
|
|
|
return getAPIInterceptor({ url });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getAssignmentResponseList(id: any) {
|
|
|
|
|
const url = `assignment/response?assignmentId=${id}`;
|
|
|
|
|
return getAPIInterceptor({ url });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function createAssignmentResponse(data: any) {
|
|
|
|
|
const url = "assignment/response";
|
|
|
|
|
return postAPIInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function deleteAssignmentResponse(id: any) {
|
|
|
|
|
const url = `assignment/response?id=${id}`;
|
|
|
|
|
return deleteAPIInterceptor(url, id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getAcceptance(id: any, isAccept: any) {
|
|
|
|
|
const url = `assignment/acceptance?id=${id}&isAccept=${isAccept}`;
|
|
|
|
|
return getAPIInterceptor({ url });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function acceptAssignment(id: any, isAccept: any) {
|
|
|
|
|
const url = `assignment/acceptance?id=${id}`;
|
|
|
|
|
return postAPIInterceptor(url, id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function postFinishAcceptance(id: any) {
|
|
|
|
|
const url = `assignment/finish-acceptance?id=${id}`;
|
|
|
|
|
return postAPIInterceptor(url, id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getAcceptanceAssignmentStatus(id: any) {
|
|
|
|
|
const url = `assignment/acceptance/status?id=${id}`;
|
|
|
|
|
return getAPIInterceptor({ url });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getListAttachment(assignmentId: any, isForCreator: any) {
|
|
|
|
|
const url = `media/list?&enablePage=0&assignmentId=${assignmentId}&isForAdmin=${isForCreator}`;
|
|
|
|
|
return getAPIInterceptor({ url });
|
|
|
|
|
}
|