From 71f12c942b2564142edec85e0136d713e04ab10f Mon Sep 17 00:00:00 2001 From: static Date: Mon, 6 Jan 2025 14:30:00 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=8C=EC=9D=BC/=ED=8F=B4=EB=8D=94=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EB=B0=8F=20=EC=9D=B4=EB=A6=84=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EA=B5=AC=ED=98=84=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/hooks/callApi.ts | 4 +- .../(main)/directory/[[id]]/+page.svelte | 37 ++++++++++++------- .../[[id]]/DeleteDirectoryEntryModal.svelte | 13 ++++--- .../DirectoryEntryMenuBottomSheet.svelte | 2 +- .../[[id]]/RenameDirectoryEntryModal.svelte | 13 ++++--- src/routes/(main)/directory/[[id]]/service.ts | 33 +++++++++++++++++ 6 files changed, 75 insertions(+), 27 deletions(-) diff --git a/src/lib/hooks/callApi.ts b/src/lib/hooks/callApi.ts index d2987a9..c08b97d 100644 --- a/src/lib/hooks/callApi.ts +++ b/src/lib/hooks/callApi.ts @@ -20,7 +20,7 @@ export const callGetApi = async (input: RequestInfo, fetchInternal?: typeof fetc export const callPostApi = async ( input: RequestInfo, - payload: T, + payload?: T, fetchInternal?: typeof fetch, ) => { return await callApi( @@ -28,7 +28,7 @@ export const callPostApi = async ( { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify(payload), + body: payload ? JSON.stringify(payload) : undefined, }, fetchInternal, ); diff --git a/src/routes/(main)/directory/[[id]]/+page.svelte b/src/routes/(main)/directory/[[id]]/+page.svelte index 7e4eafa..da91160 100644 --- a/src/routes/(main)/directory/[[id]]/+page.svelte +++ b/src/routes/(main)/directory/[[id]]/+page.svelte @@ -1,11 +1,3 @@ - - diff --git a/src/routes/(main)/directory/[[id]]/DirectoryEntryMenuBottomSheet.svelte b/src/routes/(main)/directory/[[id]]/DirectoryEntryMenuBottomSheet.svelte index 5e01939..182f494 100644 --- a/src/routes/(main)/directory/[[id]]/DirectoryEntryMenuBottomSheet.svelte +++ b/src/routes/(main)/directory/[[id]]/DirectoryEntryMenuBottomSheet.svelte @@ -1,7 +1,7 @@