diff --git a/src/lib/components/inputs/CheckBox.svelte b/src/lib/components/inputs/CheckBox.svelte new file mode 100644 index 0000000..813a7e0 --- /dev/null +++ b/src/lib/components/inputs/CheckBox.svelte @@ -0,0 +1,23 @@ + + + diff --git a/src/lib/components/inputs/index.ts b/src/lib/components/inputs/index.ts index c2c534d..47cb929 100644 --- a/src/lib/components/inputs/index.ts +++ b/src/lib/components/inputs/index.ts @@ -1 +1,2 @@ +export { default as CheckBox } from "./CheckBox.svelte"; export { default as TextInput } from "./TextInput.svelte"; diff --git a/src/lib/modules/filesystem.ts b/src/lib/modules/filesystem.ts index f098456..0e786ce 100644 --- a/src/lib/modules/filesystem.ts +++ b/src/lib/modules/filesystem.ts @@ -66,7 +66,7 @@ export type CategoryInfo = dataKeyVersion?: Date; name: string; subCategoryIds: number[]; - files: number[]; + files: { id: number; isRecursive: boolean }[]; }; const directoryInfoStore = new Map>(); @@ -256,7 +256,7 @@ const fetchCategoryInfoFromServer = async ( const { dataKey } = await unwrapDataKey(metadata!.dek, masterKey); const name = await decryptString(metadata!.name, metadata!.nameIv, dataKey); - res = await callGetApi(`/api/category/${id}/file/list`); + res = await callGetApi(`/api/category/${id}/file/list?recursive=true`); if (!res.ok) { throw new Error("Failed to fetch category files"); } @@ -269,7 +269,7 @@ const fetchCategoryInfoFromServer = async ( dataKeyVersion: new Date(metadata!.dekVersion), name, subCategoryIds: subCategories, - files, + files: files.map(({ file, isRecursive }) => ({ id: file, isRecursive })), }); } }; diff --git a/src/lib/organisms/Category/Category.svelte b/src/lib/organisms/Category/Category.svelte index d70a6d3..563293d 100644 --- a/src/lib/organisms/Category/Category.svelte +++ b/src/lib/organisms/Category/Category.svelte @@ -1,5 +1,6 @@