From e7e2f8a84dc86eb1d0c95204f2426da8a3aad671 Mon Sep 17 00:00:00 2001 From: Yang ga-hyeon Date: Fri, 21 Feb 2025 14:26:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=95=8C=EB=A6=BC=20=EC=88=9C=EC=84=9C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Gnb/Notification.tsx | 39 ++++++++++++++++------------- src/features/DetailMaker.tsx | 4 +-- src/services/planService.ts | 5 +++- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/components/Gnb/Notification.tsx b/src/components/Gnb/Notification.tsx index 163813fd..2eeee720 100644 --- a/src/components/Gnb/Notification.tsx +++ b/src/components/Gnb/Notification.tsx @@ -146,25 +146,28 @@ export default function Notification({ closeModal }: { closeModal: () => void }) className={`max-h-[300px] overflow-y-auto ${notificationData.length >= 4 ? "h-[300px]" : ""}`} > )} diff --git a/src/features/DetailMaker.tsx b/src/features/DetailMaker.tsx index f090ad32..a4087c61 100644 --- a/src/features/DetailMaker.tsx +++ b/src/features/DetailMaker.tsx @@ -109,9 +109,7 @@ export default function RequestDetailDreamer() { setIsRequestSuccessModalOpen(true); }, onError: (error: any) => { - if (error.message === "이미 지정 견적을 요청하셨습니다!") { - alert(error.message); - } + alert(error.message); }, }); diff --git a/src/services/planService.ts b/src/services/planService.ts index 2f96be6d..2cba9fa3 100644 --- a/src/services/planService.ts +++ b/src/services/planService.ts @@ -1,3 +1,4 @@ +import { BAD_REQUEST, CONFLICT } from "@/utils/errorStatus"; import { api } from "./api"; import { ServiceArea } from "@/utils/formatRegion"; @@ -128,8 +129,10 @@ const planService = { const response = await api.post(`/plans/${planId}/assign`, { assigneeId }); return response; } catch (error: any) { - if (error.response && error.response.status === 409) { + if (error.response && error.response.status === CONFLICT) { throw new Error("이미 지정 견적을 요청하셨습니다!"); + } else if (error.response && error.response.status === BAD_REQUEST) { + throw new Error("Maker가 서비스하는 지역이 아닙니다."); } } },