mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
카테고리 목록에서 파일 목록을 재귀적으로 표시할 수 있는 기능 구현
This commit is contained in:
@@ -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