mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
카테고리 목록에서 파일 목록을 재귀적으로 표시할 수 있는 기능 구현
This commit is contained in:
1 parent
8f8bad6d10
commit
f34764ffe0
9 files changed
+98
-41
No files matched your search
@@ -66,14 +66,14 @@ export const addCategoryFile = async (userId: number, categoryId: number, fileId
|
||||
}
|
||||
};
|
||||
|
||||
export const getCategoryFiles = async (userId: number, categoryId: number) => {
|
||||
export const getCategoryFiles = async (userId: number, categoryId: number, recursive: boolean) => {
|
||||
const category = await getCategory(userId, categoryId);
|
||||
if (!category) {
|
||||
error(404, "Invalid category id");
|
||||
}
|
||||
|
||||
const files = await getAllFilesByCategory(userId, categoryId);
|
||||
return { files: files.map(({ id }) => id) };
|
||||
const files = await getAllFilesByCategory(userId, categoryId, recursive);
|
||||
return { files };
|
||||
};
|
||||
|
||||
export const removeCategoryFile = async (userId: number, categoryId: number, fileId: number) => {
|
||||
|
||||
Reference in new issue
Block a user