mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
검색 필터에 즐겨찾기 여부 추가
This commit is contained in:
@@ -20,7 +20,12 @@ export const getFileCacheIndex = async () => {
|
||||
};
|
||||
|
||||
export const storeFileCacheIndex = async (fileCacheIndex: FileCacheIndex) => {
|
||||
await cacheIndex.fileCache.put(fileCacheIndex);
|
||||
await cacheIndex.fileCache.put({
|
||||
fileId: fileCacheIndex.fileId,
|
||||
cachedAt: fileCacheIndex.cachedAt,
|
||||
lastRetrievedAt: fileCacheIndex.lastRetrievedAt,
|
||||
size: fileCacheIndex.size,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteFileCacheIndex = async (fileId: number) => {
|
||||
|
||||
@@ -74,7 +74,11 @@ export const getDirectoryInfo = async (id: number) => {
|
||||
};
|
||||
|
||||
export const storeDirectoryInfo = async (directoryInfo: DirectoryInfo) => {
|
||||
await filesystem.directory.upsert(directoryInfo.id, { ...directoryInfo });
|
||||
await filesystem.directory.upsert(directoryInfo.id, {
|
||||
parentId: directoryInfo.parentId,
|
||||
name: directoryInfo.name,
|
||||
isFavorite: directoryInfo.isFavorite,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteDirectoryInfo = async (id: number) => {
|
||||
@@ -108,7 +112,15 @@ export const bulkGetFileInfos = async (ids: number[]) => {
|
||||
};
|
||||
|
||||
export const storeFileInfo = async (fileInfo: FileInfo) => {
|
||||
await filesystem.file.upsert(fileInfo.id, { ...fileInfo });
|
||||
await filesystem.file.upsert(fileInfo.id, {
|
||||
parentId: fileInfo.parentId,
|
||||
name: fileInfo.name,
|
||||
contentType: fileInfo.contentType,
|
||||
createdAt: fileInfo.createdAt,
|
||||
lastModifiedAt: fileInfo.lastModifiedAt,
|
||||
categoryIds: fileInfo.categoryIds,
|
||||
isFavorite: fileInfo.isFavorite,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteFileInfo = async (id: number) => {
|
||||
@@ -135,7 +147,12 @@ export const getCategoryInfo = async (id: number) => {
|
||||
};
|
||||
|
||||
export const storeCategoryInfo = async (categoryInfo: CategoryInfo) => {
|
||||
await filesystem.category.upsert(categoryInfo.id, { ...categoryInfo });
|
||||
await filesystem.category.upsert(categoryInfo.id, {
|
||||
parentId: categoryInfo.parentId,
|
||||
name: categoryInfo.name,
|
||||
files: categoryInfo.files,
|
||||
isFileRecursive: categoryInfo.isFileRecursive,
|
||||
});
|
||||
};
|
||||
|
||||
export const updateCategoryInfo = async (id: number, changes: { isFileRecursive?: boolean }) => {
|
||||
|
||||
Reference in New Issue
Block a user