/api/category/[id], /api/category/create Endpoint 구현

This commit is contained in:
static
2025-01-21 14:35:34 +09:00
parent f66421a5dc
commit 2993593770
10 changed files with 141 additions and 7 deletions

View File

@@ -8,11 +8,12 @@ import {
setDirectoryEncName,
unregisterDirectory,
getAllFilesByParent,
type DirectoryId,
type NewDirectory,
} from "$lib/server/db/file";
import type { Ciphertext } from "$lib/server/db/schema";
export const getDirectoryInformation = async (userId: number, directoryId: "root" | number) => {
export const getDirectoryInformation = async (userId: number, directoryId: DirectoryId) => {
const directory = directoryId !== "root" ? await getDirectory(userId, directoryId) : undefined;
if (directory === null) {
error(404, "Invalid directory id");