From 5d5b61edea80bd6f6861cb6e04aaacc853fc5b12 Mon Sep 17 00:00:00 2001 From: JAESEON PARK Date: Sun, 5 Apr 2026 00:33:09 +0900 Subject: [PATCH 01/10] =?UTF-8?q?fix:any=ED=83=80=EC=9E=85=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/axios.ts | 13 +++++++++---- src/api/bookings.ts | 12 +++++++++--- src/api/owner/menus.ts | 13 +++++++++++-- src/api/owner/storeLayout.ts | 14 ++++++++++---- src/lib/kakao.ts | 8 +++++++- 5 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/api/axios.ts b/src/api/axios.ts index 38110ff..33f52f5 100644 --- a/src/api/axios.ts +++ b/src/api/axios.ts @@ -36,15 +36,20 @@ api.interceptors.request.use((config: InternalAxiosRequestConfig) => { let refreshPromise: ReturnType | null = null; +type ApiResponseWithFlags = { + code?: string; + message?: string; + success?: boolean; + isSuccess?: boolean; +}; + api.interceptors.response.use( (res) => { const data = res.data; if (isApiResponse(data)) { + const responseData: ApiResponseWithFlags = data; const failed = - (typeof (data as any).success === "boolean" && - (data as any).success === false) || - (typeof (data as any).isSuccess === "boolean" && - (data as any).isSuccess === false); + responseData.success === false || responseData.isSuccess === false; if (failed) { return Promise.reject({ diff --git a/src/api/bookings.ts b/src/api/bookings.ts index 7c9e290..80b37cc 100644 --- a/src/api/bookings.ts +++ b/src/api/bookings.ts @@ -1,6 +1,6 @@ import { api } from "./axios"; -type ApiBookingStatus = "CONFIRMED" | "COMPLETED" | "CANCELED"; +type ApiBookingStatus = "PENDING" | "CONFIRMED" | "COMPLETED" | "CANCELED"; interface Booking { bookingId: number; @@ -9,7 +9,8 @@ interface Booking { bookingDate: string; bookingTime: string; partySize: number; - amount: number; + tableNumbers: string; + amount: number | null; paymentMethod: string; status: ApiBookingStatus; } @@ -23,11 +24,16 @@ interface BookingResponse { isLast: boolean; } +type GetBookingParams = { + page: number; + status?: ApiBookingStatus; +}; + export const getBookings = async ( status?: ApiBookingStatus, page: number = 1, ): Promise => { - const params: any = { page }; + const params: GetBookingParams = { page }; if (status) params.status = status; const response = await api.get<{ result: BookingResponse }>( diff --git a/src/api/owner/menus.ts b/src/api/owner/menus.ts index e1e09c3..d0193ed 100644 --- a/src/api/owner/menus.ts +++ b/src/api/owner/menus.ts @@ -1,3 +1,4 @@ +import axios from "axios"; import { api } from "../axios"; import type { ApiResponse } from "@/types/api"; @@ -96,12 +97,20 @@ export const deleteMenuImage = async ( `/api/v1/stores/${storeId}/menus/${menuId}/image`, ); return res.data; - } catch (err: any) { + } catch (err: unknown) { console.error("deleteMenuImage error", err); + if (axios.isAxiosError(err)) { + return { + isSuccess: false, + code: "_MENU_IMAGE_DELETE_FAILED", + message: err?.response?.data?.message || "이미지 삭제 실패", + result: { deletedImageKey: "" }, + }; + } return { isSuccess: false, code: "_MENU_IMAGE_DELETE_FAILED", - message: err?.response?.data?.message || "이미지 삭제 실패", + message: "이미지 삭제 실패", result: { deletedImageKey: "" }, }; } diff --git a/src/api/owner/storeLayout.ts b/src/api/owner/storeLayout.ts index 96e8c09..f22c065 100644 --- a/src/api/owner/storeLayout.ts +++ b/src/api/owner/storeLayout.ts @@ -1,6 +1,7 @@ import type { ApiResponse } from "@/types/api"; import { api } from "../axios"; import type { SeatsType } from "@/types/table"; +import axios from "axios"; export interface LayoutTable { tableId: number; @@ -53,8 +54,8 @@ export const getActiveLayout = async ( return null; } return null; - } catch (e: any) { - if (e.response?.status === 404) { + } catch (e: unknown) { + if (axios.isAxiosError(e) && e.response?.status === 404) { console.error("가게를 찾을 수 없음"); } else { console.error(e); @@ -97,8 +98,13 @@ export const createTable = async ( } console.error("테이블 생성 실패 응답:", res.data); return null; - } catch (e: any) { - console.error("테이블 생성 실패:", e?.response?.data ?? e); + } catch (e: unknown) { + if (axios.isAxiosError(e)) { + console.error("테이블 생성 실패:", e?.response?.data ?? e); + } else { + console.error("테이블 생성 실패:", e); + } + return null; } }; diff --git a/src/lib/kakao.ts b/src/lib/kakao.ts index 3f72f50..a8765bf 100644 --- a/src/lib/kakao.ts +++ b/src/lib/kakao.ts @@ -1,6 +1,12 @@ +type Kakao = { + maps: { + load: (callback: () => void) => void; + }; +}; + declare global { interface Window { - kakao: any; + kakao: Kakao; } } From bf58e9483dc0cd5fb4f440277fc762e0cc58e443 Mon Sep 17 00:00:00 2001 From: JAESEON PARK Date: Tue, 7 Apr 2026 16:16:53 +0900 Subject: [PATCH 02/10] =?UTF-8?q?fix:=20lint=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=A4=91(=EC=A4=91=EA=B0=84=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=EB=AA=A9=EC=A0=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/owner/stores.ts | 6 +- src/components/auth/ChangePasswordDiaLog.tsx | 9 +- src/components/auth/LoginDialog.tsx | 2 +- src/components/auth/SignupDialog.tsx | 2 +- src/components/auth/WithdrawDialog.tsx | 12 +- .../customer-support/SupportContact.tsx | 2 +- .../customer-support/SupportFAQ.tsx | 4 +- .../customer-support/SupportHero.tsx | 4 +- src/components/map/KakaoMap.tsx | 11 +- src/components/owner/BreakTimeModal.tsx | 2 +- src/components/owner/MenuManagement.tsx | 63 +++-- src/components/owner/StoreSettings.tsx | 25 +- src/components/owner/TableCreateModal.tsx | 2 +- src/components/owner/menuFormModal.tsx | 36 ++- src/components/owner/tableDashboard.tsx | 4 +- src/components/owner/tableDetailModal.tsx | 4 +- .../modals/ReservationMenuModal.tsx | 226 +++++++++--------- .../reservation/modals/ReservationModal.tsx | 4 +- src/components/restaurant/RestaurantCard.tsx | 4 +- .../store-registration/CompleteModal.tsx | 6 +- .../store-registration/ConfirmModal.tsx | 2 +- .../store-registration/MenuItemInput.tsx | 10 +- .../RegistrationStepper.tsx | 2 +- .../store-registration/StepStoreInfo.tsx | 2 +- src/pages/CustomerSupportPage.tsx | 6 +- src/types/menus.ts | 28 ++- src/types/store.ts | 9 +- 27 files changed, 280 insertions(+), 207 deletions(-) diff --git a/src/api/owner/stores.ts b/src/api/owner/stores.ts index 58d9f34..093b9e4 100644 --- a/src/api/owner/stores.ts +++ b/src/api/owner/stores.ts @@ -1,5 +1,6 @@ import { api } from "@/api/axios"; import type { ApiResponse } from "@/types/api"; +import type { UpdateStoreResponse } from "@/types/store"; interface StoreDetail { storeId: number; @@ -70,7 +71,10 @@ export function updateStore( phoneNumber: string; }, ) { - return api.patch>(`/api/v1/stores/${storeId}`, body); + return api.patch>( + `/api/v1/stores/${storeId}`, + body, + ); } export function updateBusinessHours( diff --git a/src/components/auth/ChangePasswordDiaLog.tsx b/src/components/auth/ChangePasswordDiaLog.tsx index 22d2006..a2f3834 100644 --- a/src/components/auth/ChangePasswordDiaLog.tsx +++ b/src/components/auth/ChangePasswordDiaLog.tsx @@ -5,6 +5,7 @@ import { useForm } from "react-hook-form"; import { z } from "zod"; import { Button } from "../ui/button"; import { X } from "lucide-react"; +import axios from "axios"; const schema = z .object({ @@ -43,8 +44,12 @@ export function ChangePasswordDialog({ form.reset(); onOpenChange(false); }, - onError: (e: any) => { - const msg = e?.response?.data?.message ?? "비밀번호 변경에 실패했습니다."; + onError: (e: unknown) => { + let msg = "비밀번호 변경에 실패했습니다."; + + if (axios.isAxiosError(e)) { + msg = e.response?.data?.message ?? msg; + } if (typeof msg === "string" && /현재|기존|일치|틀렸/.test(msg)) { form.setError("currentPassword", { type: "server", message: msg }); return; diff --git a/src/components/auth/LoginDialog.tsx b/src/components/auth/LoginDialog.tsx index 71fbaa3..19d9954 100644 --- a/src/components/auth/LoginDialog.tsx +++ b/src/components/auth/LoginDialog.tsx @@ -70,7 +70,7 @@ export function LoginDialog({ return ( !open && onClose()}> - + 잇츠파인에 오신 것을 환영합니다 diff --git a/src/components/auth/SignupDialog.tsx b/src/components/auth/SignupDialog.tsx index da0eb58..32880b6 100644 --- a/src/components/auth/SignupDialog.tsx +++ b/src/components/auth/SignupDialog.tsx @@ -82,7 +82,7 @@ export function SignupDialog({ return ( !open && onClose()}> - + 회원가입 diff --git a/src/components/auth/WithdrawDialog.tsx b/src/components/auth/WithdrawDialog.tsx index 2598c67..01df2b1 100644 --- a/src/components/auth/WithdrawDialog.tsx +++ b/src/components/auth/WithdrawDialog.tsx @@ -6,8 +6,10 @@ import { Button } from "../ui/button"; import { X } from "lucide-react"; import { useState } from "react"; import { logout as performLogout } from "@/api/auth"; +import axios from "axios"; -function isWithdrawBlockByBookings(e: any) { +function isWithdrawBlockByBookings(e: unknown) { + if (!axios.isAxiosError(e)) return false; const msg = e?.response?.data?.message; const result = e?.response?.data?.result; const code = e?.response?.data?.code; @@ -56,12 +58,16 @@ export function WithdrawDialog({ onOpenChange(false); nav("/", { replace: true }); }, - onError: (e: any) => { + onError: (e: unknown) => { if (isWithdrawBlockByBookings(e)) { setBlocked(true); return; } - alert(e?.response?.data?.message ?? "회원 탈퇴에 실패했습니다."); + let msg = "회원 탈퇴에 실패했습니다"; + if (axios.isAxiosError(e)) { + msg = e?.response?.data?.message ?? msg; + } + alert(msg); }, }); diff --git a/src/components/customer-support/SupportContact.tsx b/src/components/customer-support/SupportContact.tsx index 2986129..60f6ae9 100644 --- a/src/components/customer-support/SupportContact.tsx +++ b/src/components/customer-support/SupportContact.tsx @@ -1,7 +1,7 @@ export default function SupportContact() { return (
-
+
{/* 이메일 문의 */}
diff --git a/src/components/customer-support/SupportFAQ.tsx b/src/components/customer-support/SupportFAQ.tsx index a8021a8..5a84331 100644 --- a/src/components/customer-support/SupportFAQ.tsx +++ b/src/components/customer-support/SupportFAQ.tsx @@ -34,7 +34,7 @@ export default function SupportFAQ() { }; return ( -
+

자주 묻는 질문

@@ -87,7 +87,7 @@ export default function SupportFAQ() {
{/* 질문 리스트 */} -
+
{filteredFaqs.length > 0 ? ( filteredFaqs.map((faq) => (
-
-
+
+

무엇을 도와드릴까요?

자주 묻는 질문을 확인하시거나, 1:1 문의를 통해 더 자세한 도움을 diff --git a/src/components/map/KakaoMap.tsx b/src/components/map/KakaoMap.tsx index 5e2ae63..9e733c3 100644 --- a/src/components/map/KakaoMap.tsx +++ b/src/components/map/KakaoMap.tsx @@ -25,11 +25,12 @@ const toNum = (v: unknown) => { return Number.isFinite(n) ? n : null; }; -const normalizeLatLng = (loc: any): LatLng | null => { - if (!loc) return null; +const normalizeLatLng = (loc: unknown): LatLng | null => { + if (!loc || typeof loc !== "object") return null; + const maybeLoc = loc as { lat?: unknown; lng?: unknown }; - let lat = toNum(loc.lat); - let lng = toNum(loc.lng); + let lat = toNum(maybeLoc.lat); + let lng = toNum(maybeLoc.lng); if (lat == null || lng == null) return null; @@ -112,7 +113,7 @@ export default function KakaoMap({ return () => { cancelled = true; }; - }, [defaultLevel]); + }, [defaultLevel, center.lat, center.lng]); // 2. 컨테이너 사이즈 변하면 relayout useEffect(() => { diff --git a/src/components/owner/BreakTimeModal.tsx b/src/components/owner/BreakTimeModal.tsx index 1fde920..16643ac 100644 --- a/src/components/owner/BreakTimeModal.tsx +++ b/src/components/owner/BreakTimeModal.tsx @@ -37,7 +37,7 @@ const BreakTimeModal: React.FC = ({ onClick={onClose} >

e.stopPropagation()} >
-
+
{slots.map((slot) => { const isBreak = isBreakTime(slot.time, breakTimes); const isAvailable = !isBreak && slot.status === "AVAILABLE"; diff --git a/src/components/reservation/modals/ReservationMenuModal.tsx b/src/components/reservation/modals/ReservationMenuModal.tsx index 1ec3d24..b589f7b 100644 --- a/src/components/reservation/modals/ReservationMenuModal.tsx +++ b/src/components/reservation/modals/ReservationMenuModal.tsx @@ -1,7 +1,13 @@ import type { ReservationDraft } from "@/types/restaurant"; import { Minus, Plus, X } from "lucide-react"; import { Button } from "../../ui/button"; -import type { SelectedMenu, MenuCategory, MenuItem } from "@/types/menus"; +import { + type SelectedMenu, + type MenuItem, + type MenuCategory, + type UiCategory, + MenuCategoryLabel, +} from "@/types/menus"; import { useMenus } from "@/hooks/reservation/useMenus"; import { useEffect, useMemo, useState } from "react"; import { calcMenuTotal } from "@/utils/menu"; @@ -24,15 +30,6 @@ type Props = { draft: ReservationDraft; }; -const CategoryLabel: Record = { - MAIN: "메인 메뉴", - SIDE: "사이드 메뉴", - DRINK: "음료", - OTHER: "기타", -}; - -type UiCategory = MenuCategory | "OTHER"; - export default function ReservationMenuModal({ open, restaurant, @@ -77,7 +74,9 @@ export default function ReservationMenuModal({ return "SIDE"; case "DRINK": case "BEVERAGE": - return "DRINK"; + return "BEVERAGE"; + case "ALCOHOL": + return "ALCOHOL"; default: return "OTHER"; } @@ -87,7 +86,8 @@ export default function ReservationMenuModal({ const by: Record = { MAIN: [], SIDE: [], - DRINK: [], + BEVERAGE: [], + ALCOHOL: [], OTHER: [], }; for (const m of activeMenus ?? []) { @@ -183,116 +183,118 @@ export default function ReservationMenuModal({ 아직 등록된 메뉴가 없어요
) : ( - (["MAIN", "SIDE", "DRINK"] as MenuCategory[]).map((cat) => { - const list = grouped[cat]; - if (list.length === 0) return null; - const safeLabel = CategoryLabel[cat] ?? "기타"; + (["MAIN", "SIDE", "BEVERAGE", "ALCOHOL"] as MenuCategory[]).map( + (cat) => { + const list = grouped[cat]; + if (list.length === 0) return null; + const safeLabel = MenuCategoryLabel[cat] ?? "기타"; - return ( -
-
{safeLabel}
-
- {list.map((menu) => { - const qty = qtyMap.get(Number(menu.id)) ?? 0; - const img = - menu.imageUrl && menu.imageUrl.trim().length > 0 - ? menu.imageUrl - : "/modernKoreaRestaurant.jpg"; - return ( -
-
- {/* 음식사진 */} -
- {menu.name} +
{safeLabel}
+
+ {list.map((menu) => { + const qty = qtyMap.get(Number(menu.id)) ?? 0; + const img = + menu.imageUrl && menu.imageUrl.trim().length > 0 + ? menu.imageUrl + : "/modernKoreaRestaurant.jpg"; + return ( +
+
+ {/* 음식사진 */} +
+ {menu.name} + {menu.isSoldOut && ( +
+ + 품절 + +
)} - /> - {menu.isSoldOut && ( -
- - 품절 - -
- )} -
- {/* 내용 */} -
-
-
-
-

- {menu.name} -

- {menu.description ? ( -

- {menu.description} +

+ {/* 내용 */} +
+
+
+
+

+ {menu.name}

+ {menu.description ? ( +

+ {menu.description} +

+ ) : null} +
+ {qty > 0 ? ( + + {qty}개 + ) : null}
- {qty > 0 ? ( - - {qty}개 - - ) : null} +

+ {formatKrw(menu.price)}원 +

-

- {formatKrw(menu.price)}원 -

-
- {/* 수량 조절 */} -
-
- - {qty} - + {/* 수량 조절 */} +
+
+ + {qty} + +
-
- ); - })} -
-
- ); - }) + ); + })} +
+
+ ); + }, + ) )}
diff --git a/src/components/reservation/modals/ReservationModal.tsx b/src/components/reservation/modals/ReservationModal.tsx index e55697a..6933927 100644 --- a/src/components/reservation/modals/ReservationModal.tsx +++ b/src/components/reservation/modals/ReservationModal.tsx @@ -264,7 +264,7 @@ export default function ReservationModal({ - + -
+

- {categoryLabel[restaurant.category]} • {restaurant.address} + {storeCategoryLabel[restaurant.category]} • {restaurant.address}

diff --git a/src/components/store-registration/CompleteModal.tsx b/src/components/store-registration/CompleteModal.tsx index 4c3ca03..c1deeb2 100644 --- a/src/components/store-registration/CompleteModal.tsx +++ b/src/components/store-registration/CompleteModal.tsx @@ -8,7 +8,7 @@ import { import { useEffect } from "react"; import type { StoreInfoFormValues } from "./StoreInfo.schema"; import { Check } from "lucide-react"; -import { categoryLabel } from "@/types/store"; +import { storeCategoryLabel } from "@/types/store"; interface CompleteModalProps { isOpen: boolean; @@ -34,7 +34,7 @@ export default function CompleteModal({ return ( - + 가게 등록 완료! @@ -52,7 +52,7 @@ export default function CompleteModal({
음식 종류 - {data.category ? categoryLabel[data.category] : "-"} + {data.category ? storeCategoryLabel[data.category] : "-"}
diff --git a/src/components/store-registration/ConfirmModal.tsx b/src/components/store-registration/ConfirmModal.tsx index a1cdd06..e6af54e 100644 --- a/src/components/store-registration/ConfirmModal.tsx +++ b/src/components/store-registration/ConfirmModal.tsx @@ -36,7 +36,7 @@ export default function ConfirmModal({ }: ConfirmModalProps) { return ( - + {title} diff --git a/src/components/store-registration/MenuItemInput.tsx b/src/components/store-registration/MenuItemInput.tsx index 3525e32..7107bd4 100644 --- a/src/components/store-registration/MenuItemInput.tsx +++ b/src/components/store-registration/MenuItemInput.tsx @@ -17,6 +17,7 @@ import { } from "react"; import { Trash2, Upload, X } from "lucide-react"; import { Label } from "@/components/ui/label"; +import { MenuCategoryLabel } from "@/types/menus"; interface MenuItemInputProps { index: number; @@ -28,13 +29,6 @@ interface MenuItemInputProps { trigger: UseFormTrigger; } -const CATEGORY_LABELS: Record = { - MAIN: "메인 메뉴", - SIDE: "사이드 메뉴", - BEVERAGE: "음료", - ALCOHOL: "주류", -}; - export default function MenuItemInput({ index, onDelete, @@ -225,7 +219,7 @@ export default function MenuItemInput({ {...field} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer" > - {Object.entries(CATEGORY_LABELS).map(([value, label]) => ( + {Object.entries(MenuCategoryLabel).map(([value, label]) => ( diff --git a/src/components/store-registration/RegistrationStepper.tsx b/src/components/store-registration/RegistrationStepper.tsx index e662956..4c2f9ae 100644 --- a/src/components/store-registration/RegistrationStepper.tsx +++ b/src/components/store-registration/RegistrationStepper.tsx @@ -41,7 +41,7 @@ export default function RegistrationStepper({
{index !== steps.length - 1 && (
step.number ? "bg-blue-500" : "bg-gray-200" }`} style={{ minWidth: "80px" }} diff --git a/src/components/store-registration/StepStoreInfo.tsx b/src/components/store-registration/StepStoreInfo.tsx index 13ff869..854ad25 100644 --- a/src/components/store-registration/StepStoreInfo.tsx +++ b/src/components/store-registration/StepStoreInfo.tsx @@ -499,7 +499,7 @@ export default function StepStoreInfo({ aria-modal="true" >
e.stopPropagation()} > -
+
브레이크 타임 설정
diff --git a/src/components/owner/menuFormModal.tsx b/src/components/owner/menuFormModal.tsx index ae35c53..a278c75 100644 --- a/src/components/owner/menuFormModal.tsx +++ b/src/components/owner/menuFormModal.tsx @@ -107,6 +107,7 @@ const MenuFormModal: React.FC = ({ name: formData.name, category: formData.category, price: Number(formData.price), + description: formData.description.trim() || "", imageUrl: res.result.imageUrl ?? undefined, imageKey: imageKey ?? editingMenu.imageKey ?? undefined, isActive: editingMenu?.isActive ?? true, @@ -126,6 +127,7 @@ const MenuFormModal: React.FC = ({ name: formData.name, category: formData.category, price: Number(formData.price), + description: formData.description.trim() || "", imageUrl: res.result.menus[0].imageUrl, imageKey: res.result.menus[0].imageKey ?? undefined, isActive: true, diff --git a/src/components/owner/tableDetailModal.tsx b/src/components/owner/tableDetailModal.tsx index d4df711..d75098e 100644 --- a/src/components/owner/tableDetailModal.tsx +++ b/src/components/owner/tableDetailModal.tsx @@ -376,8 +376,14 @@ const TableDetailModal: React.FC = ({ ? error.response?.status : undefined; - if (status === 403) alert("접근 권한이 없습니다"); - else if (status === 404) alert("예약 정보를 찾을 수 없습니다"); + if (status === 403) { + alert("접근 권한이 없습니다"); + return; + } + if (status === 404) { + alert("예약 정보를 찾을 수 없습니다"); + return; + } const message = getErrorMessage(error); alert(message || "예약 취소에 실패했습니다"); } finally { diff --git a/src/components/reservation/modals/ReservationModal.tsx b/src/components/reservation/modals/ReservationModal.tsx index 018b46f..42552b8 100644 --- a/src/components/reservation/modals/ReservationModal.tsx +++ b/src/components/reservation/modals/ReservationModal.tsx @@ -264,7 +264,7 @@ export default function ReservationModal({ - + -
+
- + 가게 등록 완료! @@ -52,7 +52,7 @@ export default function CompleteModal({
음식 종류 - {data.category ? storeCategoryLabel[data.category] : "-"} + {data.category ? (storeCategoryLabel[data.category] ?? "-") : "-"}
diff --git a/src/components/store-registration/ConfirmModal.tsx b/src/components/store-registration/ConfirmModal.tsx index e6af54e..a1cdd06 100644 --- a/src/components/store-registration/ConfirmModal.tsx +++ b/src/components/store-registration/ConfirmModal.tsx @@ -36,7 +36,7 @@ export default function ConfirmModal({ }: ConfirmModalProps) { return ( - + {title} diff --git a/src/components/store-registration/StepBusinessAuth.tsx b/src/components/store-registration/StepBusinessAuth.tsx index 392bb38..9b6090f 100644 --- a/src/components/store-registration/StepBusinessAuth.tsx +++ b/src/components/store-registration/StepBusinessAuth.tsx @@ -149,11 +149,11 @@ export default function StepBusinessAuth({ {...register("name", { onChange: (e) => { if (isVerified) { - const { name, startDate } = getValues(); + const { businessNumber, startDate } = getValues(); setIsVerified(false); onComplete({ - name, - businessNumber: e.target.value, + name: e.target.value, + businessNumber, startDate, isVerified: false, }); @@ -193,12 +193,12 @@ export default function StepBusinessAuth({ {...register("businessNumber", { onChange: (e) => { if (isVerified) { - const { name, startDate } = getValues(); + const { name, businessNumber } = getValues(); setIsVerified(false); onComplete({ name, - businessNumber: e.target.value, - startDate, + businessNumber, + startDate: e.target.value, isVerified: false, }); } diff --git a/src/components/store-registration/StoreTransform.utils.ts b/src/components/store-registration/StoreTransform.utils.ts index 0dd1fc7..5ddd4e4 100644 --- a/src/components/store-registration/StoreTransform.utils.ts +++ b/src/components/store-registration/StoreTransform.utils.ts @@ -81,6 +81,11 @@ export const transformToRegister = ( }; }); + const bookingIntervalMinutes = Number(step2Data.bookingIntervalMinutes ?? 0); + if (!Number.isFinite(bookingIntervalMinutes) || bookingIntervalMinutes < 30) { + throw new Error("예약 시간 간격 값이 올바르지 않습니다"); + } + return { storeName: step2Data.storeName, businessNumberDto: { @@ -98,7 +103,7 @@ export const transformToRegister = ( phoneNumber: step2Data.phoneNumber, category: step2Data.category, depositRate: step2Data.depositRate, - bookingIntervalMinutes: Number(step2Data.bookingIntervalMinutes || 0), + bookingIntervalMinutes, businessHours, }; }; diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx index ca17a3d..fa2bdb0 100644 --- a/src/components/ui/checkbox.tsx +++ b/src/components/ui/checkbox.tsx @@ -12,7 +12,7 @@ function Checkbox({
-
+