upd: upload link
Deskripsi: - tampilan section link pada project dan tugas divisi - tampilan tambah link pada project dan tugas divisi - integrasi api tambah data link pada project dan tugas divisi - integrasi api hapus data link pada project dan tugas divisi No Issues
This commit is contained in:
26
lib/api.ts
26
lib/api.ts
@@ -150,7 +150,7 @@ export const apiGetUser = async ({ user, active, search, group, page }: { user:
|
||||
};
|
||||
|
||||
|
||||
export const apiCreateUser = async ({data}: {data: FormData}) => {
|
||||
export const apiCreateUser = async ({ data }: { data: FormData }) => {
|
||||
const response = await api.post('/mobile/user', data, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
@@ -264,7 +264,7 @@ export const apiGetProject = async ({ user, status, search, group, kategori, pag
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetProjectOne = async ({ user, cat, id }: { user: string, cat: 'data' | 'progress' | 'task' | 'file' | 'member', id: string }) => {
|
||||
export const apiGetProjectOne = async ({ user, cat, id }: { user: string, cat: 'data' | 'progress' | 'task' | 'file' | 'member' | 'link', id: string }) => {
|
||||
const response = await api.get(`mobile/project/${id}?user=${user}&cat=${cat}`);
|
||||
return response.data;
|
||||
};
|
||||
@@ -329,6 +329,11 @@ export const apiDeleteProject = async (data: { user: string }, id: string) => {
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiAddLinkProject = async (data: { user: string, link: string }, id: string) => {
|
||||
const response = await api.post(`/mobile/project/${id}/link`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiAddFileProject = async ({ data, id }: { data: FormData, id: string }) => {
|
||||
const response = await api.post(`/mobile/project/file/${id}`, data,
|
||||
{
|
||||
@@ -356,6 +361,11 @@ export const apiDeleteFileProject = async (data: { user: string }, id: string) =
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiDeleteLinkProject = async (data: { idLink: string, user: string }, id: string) => {
|
||||
const response = await api.delete(`/mobile/project/${id}/link`, { data })
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetDivision = async ({ user, search, group, kategori, active, page }: { user: string, search: string, group?: string, kategori?: string, active?: string, page?: number }) => {
|
||||
const response = await api.get(`mobile/division?user=${user}&active=${active}&group=${group}&search=${search}&cat=${kategori}&page=${page}`);
|
||||
return response.data;
|
||||
@@ -502,7 +512,7 @@ export const apiGetTask = async ({ user, status, search, division, page }: { use
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetTaskOne = async ({ user, cat, id }: { user: string, cat: 'data' | 'progress' | 'task' | 'file' | 'member', id: string }) => {
|
||||
export const apiGetTaskOne = async ({ user, cat, id }: { user: string, cat: 'data' | 'progress' | 'task' | 'file' | 'member' | 'link', id: string }) => {
|
||||
const response = await api.get(`mobile/task/${id}?user=${user}&cat=${cat}`);
|
||||
return response.data;
|
||||
};
|
||||
@@ -532,6 +542,11 @@ export const apiDeleteFileTask = async (data: { user: string }, id: string) => {
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiDeleteLinkTask = async (data: { user: string, idLink: string }, id: string) => {
|
||||
const response = await api.delete(`/mobile/task/${id}/link`, { data })
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiDeleteTaskMember = async (data: { user: string, idUser: string }, id: string) => {
|
||||
const response = await api.delete(`mobile/task/${id}/member`, { data })
|
||||
return response.data
|
||||
@@ -593,6 +608,11 @@ export const apiDeleteTask = async (data: { user: string }, id: string) => {
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiAddLinkTask = async (data: { user: string, link: string, idDivision: string }, id: string) => {
|
||||
const response = await api.post(`/mobile/task/${id}/link`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetDocument = async ({ user, path, division, category }: { user: string, path: string, division: string, category: 'all' | 'folder' }) => {
|
||||
const response = await api.get(`mobile/document?user=${user}&path=${path}&division=${division}&category=${category}`);
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user