fixed moving multiple folders list

This commit is contained in:
subnub
2024-10-19 00:59:37 -04:00
parent 7137be2cbc
commit fad81f319c
7 changed files with 38 additions and 21 deletions
+8 -3
View File
@@ -41,15 +41,20 @@ export const getMoveFolderListAPI = async ({
}: QueryFunctionContext<
[
string,
{ parent: string; search: string; folderID?: string; currentParent: string }
{
parent: string;
search: string;
folderIDs?: string[];
currentParent: string;
}
]
>) => {
const [_key, { parent, search, folderID, currentParent }] = queryKey;
const [_key, { parent, search, folderIDs, currentParent }] = queryKey;
const response = await axios.get(`/folder-service/move-folder-list`, {
params: {
parent,
search,
folderID,
folderIDs,
currentParent,
},
});
+9 -1
View File
@@ -37,10 +37,18 @@ const MoverPopup = () => {
folderID: "",
});
const foldersToMove = useAppSelector((state) => {
if (state.selected.multiSelectMode) {
return Object.keys(state.selected.multiSelectMap);
} else {
return [state.selected.mainSection.id];
}
});
const { data: folderList, isLoading: isLoadingFolders } = useMoveFolders(
parent?._id || "/",
debouncedSearch,
folder?._id
foldersToMove
);
const debouncedSetSearchText = useMemo(
+2 -2
View File
@@ -75,7 +75,7 @@ export const useFolder = () => {
export const useMoveFolders = (
parent: string,
search: string,
folderID?: string
folderIDs?: string[]
) => {
const params = useParams();
const moveFoldersQuery = useQuery(
@@ -84,7 +84,7 @@ export const useMoveFolders = (
{
parent,
search,
folderID,
folderIDs,
currentParent: params.id || "/",
},
],