mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-17 07:28:46 +00:00
파일 페이지에 카테고리 목록 및 카테고리에 추가 버튼 구현
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
getFile,
|
||||
setFileEncName,
|
||||
unregisterFile,
|
||||
getAllFileCategories,
|
||||
type NewFile,
|
||||
} from "$lib/server/db/file";
|
||||
import type { Ciphertext } from "$lib/server/db/schema";
|
||||
@@ -24,6 +25,7 @@ export const getFileInformation = async (userId: number, fileId: number) => {
|
||||
error(404, "Invalid file id");
|
||||
}
|
||||
|
||||
const categories = await getAllFileCategories(fileId);
|
||||
return {
|
||||
parentId: file.parentId ?? ("root" as const),
|
||||
mekVersion: file.mekVersion,
|
||||
@@ -34,6 +36,7 @@ export const getFileInformation = async (userId: number, fileId: number) => {
|
||||
encName: file.encName,
|
||||
encCreatedAt: file.encCreatedAt,
|
||||
encLastModifiedAt: file.encLastModifiedAt,
|
||||
categories: categories.map(({ id }) => id),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user