50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import httpFetch from "@/api/fetch"
|
|
import { Daily } from "./typing"
|
|
import { BASE_LABEL_API } from "../const"
|
|
|
|
export const getSelfDailyWorkList = (data: Daily.Request) => {
|
|
return httpFetch<Daily.Response>({
|
|
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/list/self",
|
|
method: "POST",
|
|
body: JSON.stringify(data),
|
|
})
|
|
}
|
|
export const getTeamDailyWorkList = (data: Daily.Request) => {
|
|
return httpFetch<Daily.Response>({
|
|
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/list/team",
|
|
method: "POST",
|
|
body: JSON.stringify(data),
|
|
})
|
|
}
|
|
|
|
export const addDailyWorkData = (data: Daily.CreateProps) => {
|
|
return httpFetch({
|
|
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/add",
|
|
method: "POST",
|
|
body: JSON.stringify(data),
|
|
})
|
|
}
|
|
|
|
export const editDailyWorkData = (data: Daily.CreateProps, id: number) => {
|
|
return httpFetch({
|
|
url: BASE_LABEL_API + `/api/v1/label_server/daily_work/edit/${id}`,
|
|
method: "put",
|
|
body: JSON.stringify(data),
|
|
})
|
|
}
|
|
|
|
export const deleteDailyWorkData = (id: number) => {
|
|
return httpFetch({
|
|
url: BASE_LABEL_API + `/api/v1/label_server/daily_work/delete/${id}`,
|
|
method: "delete",
|
|
})
|
|
}
|
|
|
|
export const lockDailyWorkData = (lock_status: boolean, id: number) => {
|
|
return httpFetch({
|
|
url: BASE_LABEL_API + `/api/v1/label_server/daily_work/lock/${id}`,
|
|
method: "put",
|
|
body: JSON.stringify({ lock_status }),
|
|
})
|
|
}
|