upd: project

Deskripsi:
- detail project
- batal project
- edit project
- tambah tugas project
- update status tugas project

No Issues'
This commit is contained in:
amel
2025-05-09 17:36:22 +08:00
parent c04c1de119
commit a9368e3e32
19 changed files with 1013 additions and 265 deletions

View File

@@ -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
};