diff --git a/src/common/hooks/useHandleError.ts b/src/common/hooks/useHandleError.ts index c1573d4d..828605ea 100644 --- a/src/common/hooks/useHandleError.ts +++ b/src/common/hooks/useHandleError.ts @@ -8,7 +8,7 @@ export const useHandleError = () => { const handleError = (error: Error, customMessage?: string) => { if (isAxiosError(error)) { openToast({ - message: error.response?.data.message || customMessage || '알 수 없는 오류가 발생했습니다', + message: customMessage || error.response?.data.message || '알 수 없는 오류가 발생했습니다', }); } }; diff --git a/src/features/detail/apis/usePostLike.ts b/src/features/detail/apis/usePostLike.ts index d6e09abf..b021a917 100644 --- a/src/features/detail/apis/usePostLike.ts +++ b/src/features/detail/apis/usePostLike.ts @@ -1,3 +1,4 @@ +import { useHandleError } from '@/common/hooks/useHandleError'; import client from '@/common/utils/client'; import { QUERY_KEYS } from '@/libs/queryKeys'; import { useMutation, useQueryClient } from '@tanstack/react-query'; @@ -9,6 +10,7 @@ const postLike = async (itemId: number) => { export const usePostLike = () => { const queryClient = useQueryClient(); + const handleError = useHandleError(); return useMutation({ mutationFn: postLike, @@ -16,5 +18,8 @@ export const usePostLike = () => { queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.ITEM_DETAIL] }); queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.ITEM_LIST] }); }, + onError: error => { + handleError(error, '로그인 후 시도해 주세요.'); + }, }); }; diff --git a/src/features/my/components/MyTrade/index.tsx b/src/features/my/components/MyTrade/index.tsx index a6998dc0..59483d16 100644 --- a/src/features/my/components/MyTrade/index.tsx +++ b/src/features/my/components/MyTrade/index.tsx @@ -3,17 +3,31 @@ import * as s from './style.css'; import { Link } from 'react-router'; import { usePostLogout } from '../../apis/usePostLogout'; import { useToast } from '@/common/hooks/useToast'; +import { REPICKA_INSTAGRAM } from '@/libs/constants'; interface MenuProps { Title: string; Icon: string; Addr: string; + Link?: string; } const Menu = ({ Title, Icon, Addr }: MenuProps) => { const { mutate: postLogout } = usePostLogout(); const { openToast } = useToast(); + if (Title === '문의하기') { + return ( + +
+ + {Title} +
+
+ + ); + } + if (Title !== '로그아웃') { return ( @@ -53,6 +67,7 @@ const MyTrade = () => {
+
diff --git a/src/libs/constants/index.ts b/src/libs/constants/index.ts index fc6b4693..ad022721 100644 --- a/src/libs/constants/index.ts +++ b/src/libs/constants/index.ts @@ -1,4 +1,6 @@ -export const VERSION_NAME = 'v1.0.1'; +export const VERSION_NAME = 'v1.0.2'; +export const REPICKA_INSTAGRAM = + 'https://www.instagram.com/repicka.shop?utm_source=ig_web_button_share_sheet&igsh=ZDNlZDc0MzIxNw=='; export const MAX_PRICE = 999999; export const MAX_LOCATION = 100;