mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 23:18:48 +00:00
/api/category/[id]/file/list Endpoint에서, recursive 쿼리 파라미터의 값을 false로 설정해도 재귀적으로 검색되던 버그 수정
This commit is contained in:
@@ -294,7 +294,7 @@ export const getAllFilesByParent = async (userId: number, parentId: DirectoryId)
|
||||
export const getAllFilesByCategory = async (
|
||||
userId: number,
|
||||
categoryId: number,
|
||||
recursive: boolean,
|
||||
recurse: boolean,
|
||||
) => {
|
||||
const files = await db
|
||||
.withRecursive("cte", (db) =>
|
||||
@@ -304,7 +304,7 @@ export const getAllFilesByCategory = async (
|
||||
.select(["id", "parent_id", "user_id", "file_category.file_id"])
|
||||
.select(sql<number>`0`.as("depth"))
|
||||
.where("id", "=", categoryId)
|
||||
.$if(recursive, (qb) =>
|
||||
.$if(recurse, (qb) =>
|
||||
qb.unionAll((db) =>
|
||||
db
|
||||
.selectFrom("category")
|
||||
|
||||
Reference in New Issue
Block a user