Skip to content

Commit 91c5e2b

Browse files
authored
[Fix] 토스페이먼츠 QA 개선 반영 (#93)
1 parent 46e38fe commit 91c5e2b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/hooks/mutation/usePostOrder.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { useMutation } from '@tanstack/react-query';
2+
import { useNavigate } from 'react-router-dom';
23
import ordersApi from '@/apis/orders/ordersApi';
4+
import RoutePath from '@/routes/routePath';
35

46
const usePostOrder = () => {
7+
const navigate = useNavigate();
58
const { mutate: postOrder, ...rest } = useMutation({
6-
mutationFn: ordersApi.POST_ORDER
9+
mutationFn: ordersApi.POST_ORDER,
10+
onError: () => navigate(RoutePath.PaymentsFail)
711
});
812

913
return { postOrder, ...rest };

src/pages/PaymentsSuccess.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect } from 'react';
22
import { useNavigate, useSearchParams } from 'react-router-dom';
3-
import { Flex, Text } from '@/components/common/Wrapper';
3+
import { Flex, Text, Space } from '@/components/common/Wrapper';
44
import { media } from '@/styles';
55
import styled from '@emotion/styled';
66

@@ -47,8 +47,8 @@ export function PaymentsSuccess() {
4747
}, [searchParams]);
4848

4949
return (
50-
<Wrapper direction="column" gap="lg" justify="start">
51-
<Flex direction="column" justify="space-between">
50+
<Wrapper direction="column" justify="space-between">
51+
<Flex direction="column" gap="lg">
5252
<Heading typo="h1" color="black">
5353
회비 결제 완료
5454
</Heading>
@@ -57,7 +57,10 @@ export function PaymentsSuccess() {
5757
<Text>이제 GDSC 정회원으로 이번 학기에 활동하실 수 있어요!</Text>
5858
</Flex>
5959
</Flex>
60-
<Button onClick={() => navigate(RoutePath.Dashboard)}>완료하기</Button>
60+
<Flex direction="column">
61+
<Button onClick={() => navigate(RoutePath.Dashboard)}>완료하기</Button>
62+
<Space height={28} />
63+
</Flex>
6164
</Wrapper>
6265
);
6366
}

0 commit comments

Comments
 (0)