From ea0790d1c7dfb01b0f26a8383c50dbaee013a012 Mon Sep 17 00:00:00 2001 From: bicochan Date: Thu, 10 Jul 2025 11:27:12 +0900 Subject: [PATCH] =?UTF-8?q?[apps/cs]=20feat:=20=ED=8C=9D=EC=97=85=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(CS=5FUT02040105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cs/src/pages/popup/api/popup-service.ts | 4 ++++ apps/cs/src/pages/popup/model/popup-interface.ts | 1 + apps/cs/src/pages/popup/ui/modify-page.tsx | 14 +++++++++++++- apps/cs/src/pages/popup/ui/popup-form.tsx | 2 +- .../src/widgets/post/ui/general-file-uploader.tsx | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/cs/src/pages/popup/api/popup-service.ts b/apps/cs/src/pages/popup/api/popup-service.ts index b82d5f473..cff4cb55e 100644 --- a/apps/cs/src/pages/popup/api/popup-service.ts +++ b/apps/cs/src/pages/popup/api/popup-service.ts @@ -41,6 +41,10 @@ export class PopupApiService implements PopupService { validatedData, ); } + + public async deletePopup(popupSn: number): Promise { + await client.delete(`${ENDPOINT.CMS_SERVICE.POPUPS}/${popupSn}`); + } } export const PopupApi = new PopupApiService(); diff --git a/apps/cs/src/pages/popup/model/popup-interface.ts b/apps/cs/src/pages/popup/model/popup-interface.ts index 6952d873f..c565df8ca 100644 --- a/apps/cs/src/pages/popup/model/popup-interface.ts +++ b/apps/cs/src/pages/popup/model/popup-interface.ts @@ -68,4 +68,5 @@ export interface PopupService { getPopupInfo(popupSn: number): Promise; createPopup(data: PopupFormData): Promise; updatePopup(popupSn: number, data: PopupUpdateFormData): Promise; + deletePopup(popupSn: number): Promise; } diff --git a/apps/cs/src/pages/popup/ui/modify-page.tsx b/apps/cs/src/pages/popup/ui/modify-page.tsx index fed70cbbb..cffce11bd 100644 --- a/apps/cs/src/pages/popup/ui/modify-page.tsx +++ b/apps/cs/src/pages/popup/ui/modify-page.tsx @@ -52,6 +52,13 @@ function ModifyPage({ popupSn }: { popupSn: number }) { }, }); + const { mutateAsync: deletePopup } = useMutationWrapper({ + mutationFn: () => PopupApi.deletePopup(popupSn), + onSuccess: () => { + alert("삭제되었습니다.", router.back); + }, + }); + const { mutateAsync: savePostingHistory } = useMutationWrapper({ mutationFn: (data: PostPayload[]) => PostingApi.savePosting(data), onSuccess: () => { @@ -101,7 +108,12 @@ function ModifyPage({ popupSn }: { popupSn: number }) {

팝업 수정

- +
diff --git a/apps/cs/src/pages/popup/ui/popup-form.tsx b/apps/cs/src/pages/popup/ui/popup-form.tsx index 8e1e5783f..3147542ed 100644 --- a/apps/cs/src/pages/popup/ui/popup-form.tsx +++ b/apps/cs/src/pages/popup/ui/popup-form.tsx @@ -32,7 +32,7 @@ const Editor = dynamic( type PopupFormProps = { form: UseFormReturn; - popupSn?: string; + popupSn?: number; handleSave: (data: T) => Promise; handleDelete?: () => Promise; }; diff --git a/apps/cs/src/widgets/post/ui/general-file-uploader.tsx b/apps/cs/src/widgets/post/ui/general-file-uploader.tsx index 2012201da..cbd77ca18 100644 --- a/apps/cs/src/widgets/post/ui/general-file-uploader.tsx +++ b/apps/cs/src/widgets/post/ui/general-file-uploader.tsx @@ -102,7 +102,7 @@ function GeneralFileUploader({ {attachment.orgnlFileNm}