upd: dokumen divisi
Deskripsi: -get all dokumen - select dokumen - tambah folder - upload file - rename dokumen - hapus dokumen - informasi dokumen - move blm selsai NO Issues
This commit is contained in:
46
lib/api.ts
46
lib/api.ts
@@ -399,7 +399,7 @@ export const apiGetDivisionMember = async ({ user, id, search }: { user: string,
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiCreateDivision = async (data: { data: { idGroup: string, name: string, desc: string }, member: [], admin: string[], user:string }) => {
|
||||
export const apiCreateDivision = async (data: { data: { idGroup: string, name: string, desc: string }, member: [], admin: string[], user: string }) => {
|
||||
const response = await api.post(`/mobile/division`, data)
|
||||
return response.data;
|
||||
};
|
||||
@@ -569,4 +569,46 @@ export const apiCreateTask = async (data: FormData) => {
|
||||
export const apiDeleteTask = async (data: { user: string }, id: string) => {
|
||||
const response = await api.delete(`/mobile/task/${id}/lainnya`, { 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;
|
||||
};
|
||||
|
||||
export const apiGetDocumentInformasi = async ({ user, item, cat }: { user: string, item: string, cat: 'share' | 'lainnya' }) => {
|
||||
const response = await api.get(`mobile/document/more?user=${user}&item=${item}&cat=${cat}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiDocumentRename = async (data: { name: string, user: string, id: string, path: string, idDivision: string, extension: string }) => {
|
||||
const response = await api.put(`/mobile/document/`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiDocumentDelete = async (data: { user: string, data: any[] }) => {
|
||||
const response = await api.delete(`/mobile/document`, { data })
|
||||
return response.data
|
||||
};
|
||||
|
||||
export const apiCreateFolderDocument = async (data: { name: string, path: string, idDivision: string, user: string }) => {
|
||||
const response = await api.post(`/mobile/document/`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiUploadFileDocument = async ({ data }: { data: FormData }) => {
|
||||
console.log(data)
|
||||
const response = await api.post(`/mobile/document/upload`, data,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
}
|
||||
)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiMoveDocument = async (data: { path: string, dataItem: any[], user: string }) => {
|
||||
const response = await api.post(`/mobile/document/more`, data)
|
||||
return response.data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user