mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-15 22:38:47 +00:00
카테고리에 파일을 추가할 수 있는 BottomSheet 구현 (WiP)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user