카테고리에 파일을 추가할 수 있는 BottomSheet 구현 (WiP)

This commit is contained in:
static
2025-01-22 13:22:16 +09:00
parent dbe2262d07
commit a2402f37a0
13 changed files with 199 additions and 72 deletions

View File

@@ -1,4 +1,6 @@
import { callPostApi } from "$lib/hooks";
import { getFileCache, storeFileCache, downloadFile } from "$lib/modules/file";
import type { CategoryFileAddRequest } from "$lib/server/schemas";
export const requestFileDownload = async (
fileId: number,
@@ -12,3 +14,10 @@ export const requestFileDownload = async (
storeFileCache(fileId, fileBuffer); // Intended
return fileBuffer;
};
export const requestFileAdditionToCategory = async (fileId: number, categoryId: number) => {
const res = await callPostApi<CategoryFileAddRequest>(`/api/category/${categoryId}/file/add`, {
file: fileId,
});
return res.ok;
};