파일 페이지에 카테고리 목록 및 카테고리에 추가 버튼 구현

This commit is contained in:
static
2025-01-22 13:50:36 +09:00
parent a2402f37a0
commit 4c0d668cc1
7 changed files with 80 additions and 28 deletions

View File

@@ -46,6 +46,7 @@ export interface FileInfo {
name: string;
createdAt?: Date;
lastModifiedAt: Date;
categoryIds: number[];
}
type CategoryId = "root" | number;
@@ -160,7 +161,7 @@ const fetchFileInfoFromIndexedDB = async (id: number, info: Writable<FileInfo |
const file = await getFileInfoFromIndexedDB(id);
if (!file) return;
info.set(file);
info.set({ ...file, categoryIds: [] });
};
const decryptDate = async (ciphertext: string, iv: string, dataKey: CryptoKey) => {
@@ -204,6 +205,7 @@ const fetchFileInfoFromServer = async (
name,
createdAt,
lastModifiedAt,
categoryIds: metadata.categories,
});
await storeFileInfo({
id,