From ce6d29bf2f545ea5350512e176fc1f285c544634 Mon Sep 17 00:00:00 2001 From: HaeJungg Date: Sun, 24 Nov 2024 21:15:26 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EB=A9=94=EC=84=B8=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gathering-detail-modal/container.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/(crew)/crew/detail/[id]/_components/gathering-detail-modal/container.tsx b/src/app/(crew)/crew/detail/[id]/_components/gathering-detail-modal/container.tsx index 3895049b..fee46ca6 100644 --- a/src/app/(crew)/crew/detail/[id]/_components/gathering-detail-modal/container.tsx +++ b/src/app/(crew)/crew/detail/[id]/_components/gathering-detail-modal/container.tsx @@ -35,11 +35,15 @@ export default function GatheringDetailModalContainer({ close(); onUpdate?.(); } catch (error) { - if (error instanceof ApiError && error.status === 401) { - const redirectUrl = `/login?redirect=${encodeURIComponent(window.location.pathname)}`; - router.push(redirectUrl); - } else { - showToast('참여 중 에러가 발생했습니다.', 'error'); + if (error instanceof ApiError) { + if (error.status === 401) { + const redirectUrl = `/login?redirect=${encodeURIComponent(window.location.pathname)}`; + router.push(redirectUrl); + } else if (error.status === 404 && error.message === '크루 멤버가 아닙니다.') { + showToast('크루 멤버가 아닙니다. 크루를 참여해보세요!', 'error'); + } else { + showToast('참여 중 에러가 발생했습니다.', 'error'); + } } } };