added restore logic and fixed delete and added multi delete

This commit is contained in:
subnub
2024-06-30 13:17:04 -04:00
parent e3970ad394
commit 9f1ab10f40
25 changed files with 633 additions and 278 deletions
+23
View File
@@ -113,6 +113,20 @@ export const trashMultiAPI = async (items: any) => {
return response.data;
};
export const restoreFileAPI = async (fileID: string) => {
const response = await axios.patch(`/file-service/restore`, {
id: fileID,
});
return response.data;
};
export const restoreMultiAPI = async (items: any) => {
const response = await axios.patch(`/file-service/restore-multi`, {
items,
});
return response.data;
};
export const renameFileAPI = async (fileID: string, name: string) => {
const response = await axios.patch(`/file-service/rename`, {
id: fileID,
@@ -130,3 +144,12 @@ export const deleteFileAPI = async (fileID: string) => {
});
return response.data;
};
export const deleteMultiAPI = async (items: any) => {
const response = await axios.delete(`/file-service/remove-multi`, {
data: {
items,
},
});
return response.data;
};