From 8850e62591cef035ee2fa14194994aba2bc87512 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Thu, 2 Apr 2026 02:03:17 +0900 Subject: [PATCH 01/10] =?UTF-8?q?fix:=20=EA=B3=B5=EC=97=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=AA=A8=EB=8B=AC=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index 8b08678a..f5f2ba2c 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -136,8 +136,8 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { openConfirmModal({ title: isCategoryChanged - ? '공지 카테고리를 수정하시겠어요?' - : '공지를 수정하시겠어요?', + ? '공연 카테고리를 수정하시겠어요?' + : '공연을 수정하시겠어요?', description: isCategoryChanged ? '카테고리를 수정하면\n해당 카테고리로 작성된 공지가 삭제돼요.' : undefined, From 5d4602643e810025969235706289b3ee9d506c31 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Thu, 2 Apr 2026 02:24:56 +0900 Subject: [PATCH 02/10] =?UTF-8?q?fix:=20=EA=B3=B5=EC=97=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=ED=9B=84=20=EC=83=81=EC=84=B8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=BA=90=EC=8B=9C=20=EA=B0=B1=EC=8B=A0=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/features/event-edit/use-event-edit.ts | 9 ++++++++- apps/host/src/pages/event-edit/event-edit.tsx | 9 +++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/host/src/features/event-edit/use-event-edit.ts b/apps/host/src/features/event-edit/use-event-edit.ts index d2eea9ac..6a4c4103 100644 --- a/apps/host/src/features/event-edit/use-event-edit.ts +++ b/apps/host/src/features/event-edit/use-event-edit.ts @@ -1,12 +1,19 @@ -import { useMutation } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { putFestival } from '@entities/event-edit/api/event-edit'; import { ORGANIZERS_QUERY_KEY } from '@shared/constants/query-key'; export const useFestivalUpdateMutation = (festivalId: number) => { + const queryClient = useQueryClient(); + return useMutation({ mutationKey: ORGANIZERS_QUERY_KEY.FESTIVAL_UPDATE(festivalId), mutationFn: (formData: FormData) => putFestival(festivalId, formData), + onSuccess: async () => { + await queryClient.invalidateQueries({ + queryKey: ORGANIZERS_QUERY_KEY.FESTIVAL_DETAIL(festivalId), + }); + }, }); }; diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index f5f2ba2c..397ced65 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -60,14 +60,11 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { const initialValues = toEventEditInitialValues(data); - const submitEdit = (values: EventFormSubmitValues) => { + const submitEdit = async (values: EventFormSubmitValues) => { const formData = serializeUpdateFestivalFormData(values); - updateMutation.mutate(formData, { - onSuccess: () => { - navigate(NAV_PATH.noticeList(festivalId)); - }, - }); + await updateMutation.mutateAsync(formData); + navigate(NAV_PATH.noticeList(festivalId)); }; const openConfirmModal = ({ From 59b7a06af628ed772497523ecec9e621dfe35561 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Sun, 5 Apr 2026 22:29:51 +0900 Subject: [PATCH 03/10] =?UTF-8?q?fix:=20=EB=AA=A8=EB=8B=AC=20=EB=AC=B8?= =?UTF-8?q?=EA=B5=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 4 ++-- .../widgets/home/festival-actions/festival-actions.tsx | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index 397ced65..8b5a8e93 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -133,8 +133,8 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { openConfirmModal({ title: isCategoryChanged - ? '공연 카테고리를 수정하시겠어요?' - : '공연을 수정하시겠어요?', + ? '공지 카테고리를 수정하시겠어요?' + : '수정하시겠어요?', description: isCategoryChanged ? '카테고리를 수정하면\n해당 카테고리로 작성된 공지가 삭제돼요.' : undefined, diff --git a/apps/host/src/widgets/home/festival-actions/festival-actions.tsx b/apps/host/src/widgets/home/festival-actions/festival-actions.tsx index 142252a0..95db19b0 100644 --- a/apps/host/src/widgets/home/festival-actions/festival-actions.tsx +++ b/apps/host/src/widgets/home/festival-actions/festival-actions.tsx @@ -27,9 +27,7 @@ const FestivalActionsView = ({ <> {children} - - 수정하기 - + 수정하기 삭제하기 @@ -37,10 +35,7 @@ const FestivalActionsView = ({ - 공연을 삭제할까요? - - 삭제한 공연은 복구할 수 없어요. - + 공연을 삭제하시겠어요? From 345df9d1b7db5f802b49e41dd94d64c76bc6cd91 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Sun, 5 Apr 2026 23:05:45 +0900 Subject: [PATCH 04/10] =?UTF-8?q?fix:=20=EB=9E=98=EB=B9=97=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index 8b5a8e93..40c742e6 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import { overlay } from 'overlay-kit'; import { useNavigate, useParams } from 'react-router'; -import { Modal, RectButton } from '@amp/ads-ui'; +import { Modal, RectButton, toast } from '@amp/ads-ui'; import { Loading } from '@amp/compositions'; import EventForm from '@widgets/event-form/event-form'; @@ -19,7 +19,7 @@ import { NAV_PATH } from '@shared/constants/path'; interface ConfirmModalProps { title: string; description?: string; - onConfirm: () => void; + onConfirm: () => Promise; } interface EventEditPageContentProps { @@ -63,8 +63,14 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { const submitEdit = async (values: EventFormSubmitValues) => { const formData = serializeUpdateFestivalFormData(values); - await updateMutation.mutateAsync(formData); - navigate(NAV_PATH.noticeList(festivalId)); + try { + await updateMutation.mutateAsync(formData); + navigate(NAV_PATH.noticeList(festivalId)); + return true; + } catch { + toast.show('공연 수정에 실패했어요. 다시 시도해주세요.'); + return false; + } }; const openConfirmModal = ({ @@ -102,10 +108,13 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { { - onConfirm(); - close(); - unmount(); + onClick={async () => { + const isSuccess = await onConfirm(); + + if (isSuccess) { + close(); + unmount(); + } }} > 확인 From 19ad73b8970a970920a7a45de73a1c9137f15f37 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Sun, 5 Apr 2026 23:26:43 +0900 Subject: [PATCH 05/10] =?UTF-8?q?fix:=20mutateAsync=EB=A5=BC=20mutate?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index 40c742e6..299bb66b 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -19,7 +19,7 @@ import { NAV_PATH } from '@shared/constants/path'; interface ConfirmModalProps { title: string; description?: string; - onConfirm: () => Promise; + values: EventFormSubmitValues; } interface EventEditPageContentProps { @@ -60,28 +60,19 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { const initialValues = toEventEditInitialValues(data); - const submitEdit = async (values: EventFormSubmitValues) => { - const formData = serializeUpdateFestivalFormData(values); - - try { - await updateMutation.mutateAsync(formData); - navigate(NAV_PATH.noticeList(festivalId)); - return true; - } catch { - toast.show('공연 수정에 실패했어요. 다시 시도해주세요.'); - return false; - } - }; - const openConfirmModal = ({ title, description, - onConfirm, + values, }: ConfirmModalProps) => { overlay.open(({ isOpen, close, unmount }) => ( { + if (updateMutation.isPending) { + return; + } + close(); unmount(); }} @@ -108,13 +99,22 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { { - const isSuccess = await onConfirm(); - - if (isSuccess) { - close(); - unmount(); - } + onClick={() => { + const formData = serializeUpdateFestivalFormData(values); + + updateMutation.mutate(formData, { + onSuccess: () => { + close(); + unmount(); + navigate(NAV_PATH.noticeList(festivalId)); + }, + onError: () => { + toast.show( + '공연 수정에 실패했어요.', + '잠시 후 다시 시도해 주세요.', + ); + }, + }); }} > 확인 @@ -147,7 +147,7 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { description: isCategoryChanged ? '카테고리를 수정하면\n해당 카테고리로 작성된 공지가 삭제돼요.' : undefined, - onConfirm: () => submitEdit(values), + values, }); }} /> From 576573a03b57386ede5818408c42bb59fad88990 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Sun, 5 Apr 2026 23:32:07 +0900 Subject: [PATCH 06/10] =?UTF-8?q?fix:=20=EC=88=98=EC=A0=95=20=EC=9A=94?= =?UTF-8?q?=EC=B2=AD=20=EC=A4=91=20=EB=AA=A8=EB=8B=AC=20=EC=B7=A8=EC=86=8C?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EB=B9=84=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index 299bb66b..fafbc442 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -88,6 +88,7 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { { close(); unmount(); From b398ce24489eef63c316c2262d54ec13df75d0c4 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Mon, 6 Apr 2026 00:01:24 +0900 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EB=AA=A8=EB=8B=AC=20=EB=B6=84=EA=B8=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index fafbc442..b76bc4e3 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -26,17 +26,6 @@ interface EventEditPageContentProps { festivalId: number; } -const areSameCategoryIds = (prev: number[], next: number[]) => { - if (prev.length !== next.length) { - return false; - } - - const sortedPrev = [...prev].sort((a, b) => a - b); - const sortedNext = [...next].sort((a, b) => a - b); - - return sortedPrev.every((id, index) => id === sortedNext[index]); -}; - const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { const updateMutation = useFestivalUpdateMutation(festivalId); @@ -136,16 +125,15 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { return; } - const isCategoryChanged = !areSameCategoryIds( - initialValues.activeCategoryIds, - values.activeCategoryIds, + const hasDeletedCategory = initialValues.activeCategoryIds.some( + (id) => !values.activeCategoryIds.includes(id), ); openConfirmModal({ - title: isCategoryChanged + title: hasDeletedCategory ? '공지 카테고리를 수정하시겠어요?' : '수정하시겠어요?', - description: isCategoryChanged + description: hasDeletedCategory ? '카테고리를 수정하면\n해당 카테고리로 작성된 공지가 삭제돼요.' : undefined, values, From 324254d766b7331436fbd909ab25476e9be551e8 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Fri, 10 Apr 2026 00:21:59 +0900 Subject: [PATCH 08/10] =?UTF-8?q?refactor:=20handleConfirmEdit=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index b76bc4e3..627345eb 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -47,6 +47,22 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { return null; } + const handleConfirmEdit = ( + values: EventFormSubmitValues, + closeModal: () => void, + ) => { + const formData = serializeUpdateFestivalFormData(values); + + updateMutation.mutate(formData, { + onSuccess: () => { + closeModal(); + navigate(NAV_PATH.noticeList(festivalId)); + }, + onError: () => { + toast.show('공연 수정에 실패했어요. 잠시 후 다시 시도해 주세요.'); + }, + }); + }; const initialValues = toEventEditInitialValues(data); const openConfirmModal = ({ @@ -90,20 +106,9 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { variant='primary' disabled={updateMutation.isPending} onClick={() => { - const formData = serializeUpdateFestivalFormData(values); - - updateMutation.mutate(formData, { - onSuccess: () => { - close(); - unmount(); - navigate(NAV_PATH.noticeList(festivalId)); - }, - onError: () => { - toast.show( - '공연 수정에 실패했어요.', - '잠시 후 다시 시도해 주세요.', - ); - }, + handleConfirmEdit(values, () => { + close(); + unmount(); }); }} > From 8517c1e6e410738e1c3ed8b249a514435e753c2b Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Fri, 10 Apr 2026 00:27:26 +0900 Subject: [PATCH 09/10] =?UTF-8?q?feat:=20=ED=95=B8=EB=93=A4=EB=9F=AC?= =?UTF-8?q?=EC=97=90=20isPending=20=EA=B0=80=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index 627345eb..a09f4f59 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -51,6 +51,10 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { values: EventFormSubmitValues, closeModal: () => void, ) => { + if (updateMutation.isPending) { + return; + } + const formData = serializeUpdateFestivalFormData(values); updateMutation.mutate(formData, { @@ -63,6 +67,7 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { }, }); }; + const initialValues = toEventEditInitialValues(data); const openConfirmModal = ({ From 175e797a8601024a0722b1fa4b423babd1f501c9 Mon Sep 17 00:00:00 2001 From: eunkr82 Date: Fri, 10 Apr 2026 12:28:11 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20isPending=20=EA=B0=80=EB=93=9C=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/host/src/pages/event-edit/event-edit.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/host/src/pages/event-edit/event-edit.tsx b/apps/host/src/pages/event-edit/event-edit.tsx index a09f4f59..72c43133 100644 --- a/apps/host/src/pages/event-edit/event-edit.tsx +++ b/apps/host/src/pages/event-edit/event-edit.tsx @@ -51,10 +51,6 @@ const EventEditPageContent = ({ festivalId }: EventEditPageContentProps) => { values: EventFormSubmitValues, closeModal: () => void, ) => { - if (updateMutation.isPending) { - return; - } - const formData = serializeUpdateFestivalFormData(values); updateMutation.mutate(formData, {