Skip to content

Commit

Permalink
[Fix] 토스페이먼츠 결제성공 페이지 가드 임시삭제 (#94)
Browse files Browse the repository at this point in the history
* fix: PaymentsSuccess 가드 임시 삭제

* fix: 전체 금액이 0 미만일 때 0으로 처리

* fix: 사용하지 않는 import 삭제
  • Loading branch information
hamo-o authored Aug 7, 2024
1 parent ec0f37a commit 3dad6b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/hooks/zustand/useProduct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const useProductStore = create<ProductStore>((set) => ({
setDiscount: (newDiscount, couponId) =>
set((state) => ({
discount: newDiscount,
totalAmount: state.amount - newDiscount,
totalAmount:
state.amount - newDiscount < 0 ? 0 : state.amount - newDiscount,
issuedCouponId: couponId
}))
}));
Expand Down
4 changes: 1 addition & 3 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -108,8 +107,7 @@ const router = sentryCreateBrowserRouter([
},
{
path: RoutePath.PaymentsSuccess,
element: <PaymentSuccessAccessGuard />,
children: [{ index: true, element: <PaymentsSuccess /> }]
element: <PaymentsSuccess />
},
// Todo: 404 Not found page
{ path: '*', element: <Text>not found page</Text> }
Expand Down

0 comments on commit 3dad6b1

Please sign in to comment.