🐛 Fix bug unable to recreate document or folder

This commit is contained in:
lethemanh
2025-03-03 11:49:43 +07:00
parent e2680d8704
commit e4b5750df8
5 changed files with 50 additions and 5 deletions
@@ -263,3 +263,16 @@ export const getFilesTree = (
}
});
};
export const getFileIdsInTree = (tree: FileTreeObject['tree']): string[] => {
const fileIds: string[] = [];
for (const directory of Object.keys(tree)) {
if (tree[directory].root) {
fileIds.push(tree[directory].root as string);
} else {
getFileIdsInTree(tree[directory] as FileTreeObject['tree']);
}
}
return fileIds;
}