added multiselect logic, implemented trash and multi trash

This commit is contained in:
subnub
2024-06-27 23:31:45 -04:00
parent 99201318b5
commit 9f0821253d
28 changed files with 707 additions and 63 deletions
+10 -1
View File
@@ -6,6 +6,7 @@ interface QueryKeyParams {
search?: string;
sortBy?: string;
limit?: number;
trashMode?: boolean;
}
// GET
@@ -13,13 +14,14 @@ interface QueryKeyParams {
export const getFoldersListAPI = async ({
queryKey,
}: QueryFunctionContext<[string, QueryKeyParams]>) => {
const [_key, { parent, search, sortBy, limit }] = queryKey;
const [_key, { parent, search, sortBy, limit, trashMode }] = queryKey;
const response = await axios.get(`/folder-service/list`, {
params: {
parent,
search,
sortBy,
limit,
trashMode,
},
});
return response.data;
@@ -54,6 +56,13 @@ export const renameFolder = async (folderID: string, name: string) => {
return response.data;
};
export const trashFolderAPI = (folderID: string) => {
const response = axios.patch("/folder-service/trash", {
id: folderID,
});
return response.data;
};
// DELETE
export const deleteFolder = async (folderID: string, parentList: string[]) => {