upd: project
Deskripsi: - detail project - batal project - edit project - tambah tugas project - update status tugas project No Issues'
This commit is contained in:
25
lib/api.ts
25
lib/api.ts
@@ -236,4 +236,29 @@ export const apiDeleteAnnouncement = async (data: { user: string }, id: string)
|
||||
export const apiGetProject = async ({ user, status, search, group, kategori }: { user: string, status: string, search: string, group?: string, kategori?: string }) => {
|
||||
const response = await api.get(`mobile/project?user=${user}&status=${status}&group=${group}&search=${search}&cat=${kategori}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetProjectOne = async ({ user, cat, id }: { user: string, cat: 'data' | 'progress' | 'task' | 'file' | 'member', id: string }) => {
|
||||
const response = await api.get(`mobile/project/${id}?user=${user}&cat=${cat}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiEditProject = async (data: { name: string, user: string }, id: string) => {
|
||||
const response = await api.put(`/mobile/project/${id}`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiCreateProjectTask = async ({ data, id }: { data: { name: string, dateStart: Date, user: string, dateEnd: Date }, id: string }) => {
|
||||
const response = await api.post(`/mobile/project/${id}`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiCancelProject = async (data: { user: string, reason: string }, id: string) => {
|
||||
const response = await api.delete(`mobile/project/${id}`, { data })
|
||||
return response.data
|
||||
};
|
||||
|
||||
export const apiUpdateStatusProjectTask = async (data: { user: string, status: number, idProject: string }, id: string) => {
|
||||
const response = await api.put(`mobile/project/detail/${id}`, data)
|
||||
return response.data
|
||||
};
|
||||
Reference in New Issue
Block a user