Skip to content

Commit

Permalink
fix: API 임시 에러처리
Browse files Browse the repository at this point in the history
  • Loading branch information
hamo-o committed Aug 7, 2024
1 parent f4b9fcf commit 658b6ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hooks/mutation/usePostOrder.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { useMutation } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
import ordersApi from '@/apis/orders/ordersApi';
import RoutePath from '@/routes/routePath';

const usePostOrder = () => {
const navigate = useNavigate();
const { mutate: postOrder, ...rest } = useMutation({
mutationFn: ordersApi.POST_ORDER
mutationFn: ordersApi.POST_ORDER,
onError: () => navigate(RoutePath.PaymentsFail)
});

return { postOrder, ...rest };
Expand Down

0 comments on commit 658b6ca

Please sign in to comment.