From 3dad6b1365b27ad7c4140b479ad70310b33e8e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=84=EC=98=81?= <89445100+hamo-o@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:47:49 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=ED=86=A0=EC=8A=A4=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EB=A8=BC=EC=B8=A0=20=EA=B2=B0=EC=A0=9C=EC=84=B1=EA=B3=B5=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B0=80=EB=93=9C=20=EC=9E=84?= =?UTF-8?q?=EC=8B=9C=EC=82=AD=EC=A0=9C=20(#94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: PaymentsSuccess 가드 임시 삭제 * fix: 전체 금액이 0 미만일 때 0으로 처리 * fix: 사용하지 않는 import 삭제 --- src/hooks/zustand/useProduct.ts | 3 ++- src/routes/index.tsx | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hooks/zustand/useProduct.ts b/src/hooks/zustand/useProduct.ts index 268c63f..b97c1c8 100644 --- a/src/hooks/zustand/useProduct.ts +++ b/src/hooks/zustand/useProduct.ts @@ -19,7 +19,8 @@ export const useProductStore = create((set) => ({ setDiscount: (newDiscount, couponId) => set((state) => ({ discount: newDiscount, - totalAmount: state.amount - newDiscount, + totalAmount: + state.amount - newDiscount < 0 ? 0 : state.amount - newDiscount, issuedCouponId: couponId })) })); diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 7ee1c0e..a6342f4 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -2,7 +2,6 @@ import App from '@/App'; import * as Sentry from '@sentry/react'; import RoutePath from '@/routes/routePath'; import { RouterProvider, createBrowserRouter } from 'react-router-dom'; -import PaymentSuccessAccessGuard from '@/components/auth/guard/PaymentSuccessAccessGuard'; import Layout from '@/components/layout/Layout'; import AuthAccessGuard from '@/components/auth/guard/AuthAccessGuard'; import { Text } from '@/components/common/Wrapper'; @@ -108,8 +107,7 @@ const router = sentryCreateBrowserRouter([ }, { path: RoutePath.PaymentsSuccess, - element: , - children: [{ index: true, element: }] + element: }, // Todo: 404 Not found page { path: '*', element: not found page }