feat(label): add label page
This commit is contained in:
49
components/label/api/daily/index.ts
Normal file
49
components/label/api/daily/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
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 }),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user