mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
카테고리 페이지에 파일 제거 버튼 구현
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { callPostApi } from "$lib/hooks";
|
||||
import { generateDataKey, wrapDataKey, encryptString } from "$lib/modules/crypto";
|
||||
import type { CategoryCreateRequest } from "$lib/server/schemas";
|
||||
import type { CategoryCreateRequest, CategoryFileRemoveRequest } from "$lib/server/schemas";
|
||||
import type { MasterKey } from "$lib/stores";
|
||||
|
||||
export const requestCategoryCreation = async (
|
||||
@@ -19,3 +19,11 @@ export const requestCategoryCreation = async (
|
||||
nameIv: nameEncrypted.iv,
|
||||
});
|
||||
};
|
||||
|
||||
export const requestFileRemovalFromCategory = async (fileId: number, categoryId: number) => {
|
||||
const res = await callPostApi<CategoryFileRemoveRequest>(
|
||||
`/api/category/${categoryId}/file/remove`,
|
||||
{ file: fileId },
|
||||
);
|
||||
return res.ok;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user