From fcf5e2f8ddcf27490d259c879f7643857a144810 Mon Sep 17 00:00:00 2001 From: juyeon-park Date: Fri, 10 Nov 2023 15:21:21 +0900 Subject: [PATCH 1/7] =?UTF-8?q?:construction:=20=EC=A0=9C=EC=95=88?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/card/suggest-card/SuggestCard.tsx | 13 +++++++++- src/hooks/api/mutations/useSuggestItem.ts | 26 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/hooks/api/mutations/useSuggestItem.ts diff --git a/src/components/domain/card/suggest-card/SuggestCard.tsx b/src/components/domain/card/suggest-card/SuggestCard.tsx index a1b8bb62..4be80e19 100644 --- a/src/components/domain/card/suggest-card/SuggestCard.tsx +++ b/src/components/domain/card/suggest-card/SuggestCard.tsx @@ -1,3 +1,5 @@ +'use client' + import Button from '@/components/ui/Button' import Card from '@/components/ui/Card' import { CardFlex, CardImage, CardText } from '@/components/ui/Card/Card' @@ -18,6 +20,15 @@ const SuggestCard = ({ priceRange, suggestionType, }: SuggestCardProps) => { + const onClickSuggest = () => { + if (suggestionType === 'offer') { + alert('오퍼하기 클릭됨') + // + } else { + alert('찔러보기 클릭됨') + } + } + return ( {itemName} {priceRange}
-
diff --git a/src/hooks/api/mutations/useSuggestItem.ts b/src/hooks/api/mutations/useSuggestItem.ts new file mode 100644 index 00000000..79ca9ba3 --- /dev/null +++ b/src/hooks/api/mutations/useSuggestItem.ts @@ -0,0 +1,26 @@ +// import { useMutation } from '@tanstack/react-query' + +// interface RequestData { +// fromCardId: number +// toCardId: number +// suggestionType: string +// } +// const suggestItem = ({ +// suggestionType, +// fromCardId, +// toCardId, +// }: RequestData) => {} +// const useSuggestItem = ({ +// suggestionType, +// fromCardId, +// toCardId, +// }: RequestData) => { +// return useMutation({ +// mutationFn: () => suggestItem({ suggestionType, fromCardId, toCardId }), +// onSuccess: (data) => { +// console.log(data) +// }, +// }) +// } + +// export default useSuggestItem From b451e80cab8fd7eac5361825cbabec7cd7f6d033 Mon Sep 17 00:00:00 2001 From: juyeon-park Date: Sat, 11 Nov 2023 18:56:33 +0900 Subject: [PATCH 2/7] =?UTF-8?q?:tada:=20=EA=B1=B0=EB=9E=98=20=EC=A0=9C?= =?UTF-8?q?=EC=95=88=20=EB=A1=9C=EC=A7=81=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/trade-section/SuggestList.tsx | 21 +++++-- .../components/trade-section/TradeSection.tsx | 22 +------- .../card/suggest-card/SuggestCard.stories.tsx | 6 +- .../domain/card/suggest-card/SuggestCard.tsx | 37 +++++++++---- src/config/apiEndPoint.ts | 1 + src/hooks/api/mutations/useSuggestItem.ts | 26 --------- src/hooks/api/mutations/useSuggestMutation.ts | 54 ++++++++++++++++++ src/hooks/api/queries/useSuggestionsQuery.ts | 11 ++++ src/lib/msw/mocks/itemHandlers.ts | 2 +- src/lib/msw/mocks/suggestHandlers.ts | 55 +++++++++++++++++-- src/services/suggest/suggest.ts | 15 ++++- src/types/index.ts | 8 ++- 12 files changed, 188 insertions(+), 70 deletions(-) delete mode 100644 src/hooks/api/mutations/useSuggestItem.ts create mode 100644 src/hooks/api/mutations/useSuggestMutation.ts create mode 100644 src/hooks/api/queries/useSuggestionsQuery.ts diff --git a/src/app/(root)/(routes)/items/[itemId]/components/trade-section/SuggestList.tsx b/src/app/(root)/(routes)/items/[itemId]/components/trade-section/SuggestList.tsx index 369e2b21..cb4f86a7 100644 --- a/src/app/(root)/(routes)/items/[itemId]/components/trade-section/SuggestList.tsx +++ b/src/app/(root)/(routes)/items/[itemId]/components/trade-section/SuggestList.tsx @@ -7,26 +7,32 @@ import { ItemSuggestion } from '@/types' type SuggestListProps = { suggestionData: ItemSuggestion[] pokeAvailable: boolean + toCardId: number } /** * TODO : 스크롤바 디자인 수정 * TODO : 실제 API 연결(useMutation 사용해서) */ -const SuggestList = ({ suggestionData, pokeAvailable }: SuggestListProps) => { +const SuggestList = ({ + suggestionData, + pokeAvailable, + toCardId, +}: SuggestListProps) => { + console.log(suggestionData) return ( - + - 오퍼하기 - 찔러보기 + 오퍼하기 + 찔러보기 - {['offer', 'poke'].map((type) => ( + {['OFFER', 'POKE'].map((type) => ( - {!pokeAvailable && type === 'poke' ? ( + {!pokeAvailable && type === 'POKE' ? (
{ itemName={v.itemName} priceRange={v.priceRange} suggestionType={v.suggestionType} + cardId={v.cardId} + toCardId={toCardId} + suggestionStatus={v.suggestionStatus} /> )) )} diff --git a/src/app/(root)/(routes)/items/[itemId]/components/trade-section/TradeSection.tsx b/src/app/(root)/(routes)/items/[itemId]/components/trade-section/TradeSection.tsx index 0b264d58..2d5e2d6f 100644 --- a/src/app/(root)/(routes)/items/[itemId]/components/trade-section/TradeSection.tsx +++ b/src/app/(root)/(routes)/items/[itemId]/components/trade-section/TradeSection.tsx @@ -9,6 +9,7 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/Dialog' +import useSuggestionsQuery from '@/hooks/api/queries/useSuggestionsQuery' import { handleApiError } from '@/lib/handleApiError' import { getSuggestions } from '@/services/suggest/suggest' import SuggestList from './SuggestList' @@ -49,7 +50,6 @@ const TradeSection = ({ const isLoggedIn = true const isMyItem = currentUser.userId === authorId - const [suggestions, setSuggestions] = useState([]) const [open, setOpen] = useState(false) const tradeInfo: TradeInfo[] = [ @@ -66,24 +66,7 @@ const TradeSection = ({ } } - const router = useRouter() - - useEffect(() => { - async function getSuggestionsValue(itemId: number) { - try { - const res = await getSuggestions(itemId) - setSuggestions(res.data.cardList) - } catch (e) { - const { shouldRedirect } = handleApiError(e) - if (shouldRedirect) { - router.push(shouldRedirect) - } else { - console.log(shouldRedirect, e) - } - } - } - getSuggestionsValue(itemId) - }, [itemId]) + const { data: suggestions } = useSuggestionsQuery(itemId) return (
@@ -107,6 +90,7 @@ const TradeSection = ({ 제안 가능한 내 물건 보기 diff --git a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx b/src/components/domain/card/suggest-card/SuggestCard.stories.tsx index de6b0705..30ada46c 100644 --- a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx +++ b/src/components/domain/card/suggest-card/SuggestCard.stories.tsx @@ -17,6 +17,8 @@ export const Normal: Story = { itemName: '에어팟 맥스', priceRange: '30만원대', suggestionType: '오퍼하기', + cardId: 1, + toCardId: 3, }, render: () => { return ( @@ -24,7 +26,9 @@ export const Normal: Story = { cardTitle={'에어팟 맥스 교환해요'} itemName={'에어팟 맥스'} priceRange={'30만원대'} - suggestionType={'offer'} + suggestionType={'OFFER'} + cardId={1} + toCardId={3} /> ) }, diff --git a/src/components/domain/card/suggest-card/SuggestCard.tsx b/src/components/domain/card/suggest-card/SuggestCard.tsx index 4be80e19..f9996b24 100644 --- a/src/components/domain/card/suggest-card/SuggestCard.tsx +++ b/src/components/domain/card/suggest-card/SuggestCard.tsx @@ -4,6 +4,7 @@ import Button from '@/components/ui/Button' import Card from '@/components/ui/Card' import { CardFlex, CardImage, CardText } from '@/components/ui/Card/Card' import { DEFAULT_ITEM_THUMBNAIL_IMG } from '@/constants/image' +import useSuggestMutation from '@/hooks/api/mutations/useSuggestMutation' type SuggestCardProps = { thumbNail?: string @@ -11,6 +12,9 @@ type SuggestCardProps = { itemName: string priceRange: string suggestionType: string + cardId: number + toCardId: number + suggestionStatus: string | null } const SuggestCard = ({ @@ -19,16 +23,20 @@ const SuggestCard = ({ itemName, priceRange, suggestionType, + cardId, + toCardId, + suggestionStatus, }: SuggestCardProps) => { - const onClickSuggest = () => { - if (suggestionType === 'offer') { - alert('오퍼하기 클릭됨') - // - } else { - alert('찔러보기 클릭됨') - } - } + const { mutate } = useSuggestMutation(toCardId, cardId) + const onClickSuggest = async (type: string) => { + mutate({ + suggestionType: type, + fromCardId: cardId, + toCardId: toCardId, + }) + } + console.log(suggestionStatus) return ( {itemName} {priceRange}
-
diff --git a/src/config/apiEndPoint.ts b/src/config/apiEndPoint.ts index 9178cf7e..68e00707 100644 --- a/src/config/apiEndPoint.ts +++ b/src/config/apiEndPoint.ts @@ -9,6 +9,7 @@ const ApiEndPoint = { suggestions: (itemId: number) => `/${itemId}/available-cards`, putUserProfile: () => '/users/profile-image', putUserNickname: () => '/users/nickname', + postSuggestion: (suggestionType: string) => `/${suggestionType}`, } as const export default ApiEndPoint diff --git a/src/hooks/api/mutations/useSuggestItem.ts b/src/hooks/api/mutations/useSuggestItem.ts deleted file mode 100644 index 79ca9ba3..00000000 --- a/src/hooks/api/mutations/useSuggestItem.ts +++ /dev/null @@ -1,26 +0,0 @@ -// import { useMutation } from '@tanstack/react-query' - -// interface RequestData { -// fromCardId: number -// toCardId: number -// suggestionType: string -// } -// const suggestItem = ({ -// suggestionType, -// fromCardId, -// toCardId, -// }: RequestData) => {} -// const useSuggestItem = ({ -// suggestionType, -// fromCardId, -// toCardId, -// }: RequestData) => { -// return useMutation({ -// mutationFn: () => suggestItem({ suggestionType, fromCardId, toCardId }), -// onSuccess: (data) => { -// console.log(data) -// }, -// }) -// } - -// export default useSuggestItem diff --git a/src/hooks/api/mutations/useSuggestMutation.ts b/src/hooks/api/mutations/useSuggestMutation.ts new file mode 100644 index 00000000..d5df4ed1 --- /dev/null +++ b/src/hooks/api/mutations/useSuggestMutation.ts @@ -0,0 +1,54 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query' +import { useRouter } from 'next/navigation' +import { toast } from '@/hooks/useToast' +import { handleApiError } from '@/lib/handleApiError' +import { postSuggestion } from '@/services/suggest/suggest' +import { ItemSuggestion } from '@/types' + +const useSuggestMutation = (toCardId: number, fromCardId: number) => { + const queryClient = useQueryClient() + const router = useRouter() + + const queryKey = [toCardId, 'suggestions'] + return useMutation({ + mutationFn: postSuggestion, + onMutate: async () => { + // 롤백을 위한 이전 값 저장 + const previousSuggestions = queryClient.getQueryData([ + toCardId, + 'suggestions', + ]) as ItemSuggestion[] + + await queryClient.cancelQueries({ queryKey }) + + const updateSuggestions = previousSuggestions + + //낙관적 업데이트 + const indexToUpdate = previousSuggestions.findIndex( + (suggestion) => suggestion.cardId === fromCardId, + ) + updateSuggestions[indexToUpdate].suggestionStatus = 'WAITING' + queryClient.setQueryData(queryKey, updateSuggestions) + + return { previousSuggestions } + }, + onError: (error, _, context) => { + queryClient.setQueryData(queryKey, context?.previousSuggestions) + const { shouldRedirect } = handleApiError(error) + if (shouldRedirect) { + router.push(shouldRedirect) + } else { + console.log(shouldRedirect, error) + toast({ + title: '제안을 실패했습니다', + duration: 2000, + }) + } + }, + onSettled: () => { + queryClient.invalidateQueries({ queryKey }) + }, + }) +} + +export default useSuggestMutation diff --git a/src/hooks/api/queries/useSuggestionsQuery.ts b/src/hooks/api/queries/useSuggestionsQuery.ts new file mode 100644 index 00000000..a9da5492 --- /dev/null +++ b/src/hooks/api/queries/useSuggestionsQuery.ts @@ -0,0 +1,11 @@ +import { useQuery } from '@tanstack/react-query' +import { getSuggestions } from '@/services/suggest/suggest' + +const useSuggestionsQuery = (itemId: number) => { + return useQuery({ + queryKey: [itemId, 'suggestions'] as const, + queryFn: () => getSuggestions(itemId), + }) +} + +export default useSuggestionsQuery diff --git a/src/lib/msw/mocks/itemHandlers.ts b/src/lib/msw/mocks/itemHandlers.ts index cbff16c6..40bfbe24 100644 --- a/src/lib/msw/mocks/itemHandlers.ts +++ b/src/lib/msw/mocks/itemHandlers.ts @@ -31,7 +31,7 @@ export const itemHandlers = [ cardTitle: '아이폰 16 팝니다', category: '전자기기', itemName: '아이폰 16', - pokeAvailable: false, + pokeAvailable: true, createdAt: '2023-10-23-20:08', modifiedAt: '2023-10-24-20:08', viewCount: 19, diff --git a/src/lib/msw/mocks/suggestHandlers.ts b/src/lib/msw/mocks/suggestHandlers.ts index b1d6d43f..1726cc3a 100644 --- a/src/lib/msw/mocks/suggestHandlers.ts +++ b/src/lib/msw/mocks/suggestHandlers.ts @@ -23,7 +23,8 @@ export const suggestHandlers = [ cardTitle: 'xxx', itemName: '다이슨 청소기', priceRange: '10만원대', - suggestionType: 'offer', + suggestionType: 'OFFER', + suggestionStatus: 'WAITING', }, { _id: 2, @@ -32,7 +33,8 @@ export const suggestHandlers = [ cardTitle: 'xxx', itemName: '애플 워치', priceRange: '20만원대', - suggestionType: 'poke', + suggestionType: 'POKE', + suggestionStatus: null, }, { _id: 3, @@ -41,7 +43,8 @@ export const suggestHandlers = [ cardTitle: 'xxx', itemName: '에어팟 프로', priceRange: '20만원대', - suggestionType: 'poke', + suggestionType: 'POKE', + suggestionStatus: null, }, { _id: 4, @@ -50,7 +53,8 @@ export const suggestHandlers = [ cardTitle: 'xxx', itemName: '에어팟 프로', priceRange: '20만원대', - suggestionType: 'poke', + suggestionType: 'POKE', + suggestionStatus: null, }, { _id: 5, @@ -59,7 +63,8 @@ export const suggestHandlers = [ cardTitle: 'xxx', itemName: '에어팟 프로', priceRange: '20만원대', - suggestionType: 'poke', + suggestionType: 'POKE', + suggestionStatus: 'WAITING', }, ], }, @@ -67,4 +72,44 @@ export const suggestHandlers = [ ) }, ), + rest.post( + `${baseUrl}${ApiEndPoint.postSuggestion('POKE')}`, + async (_req, res, ctx) => { + return res( + ctx.status(200), + ctx.json({ + code: 'SUCCESS', + message: '성공하였습니다.', + data: { + suggestionId: 1, + suggestionType: 'POKE', + fromCardId: 1, + toCardId: 3, + suggestionStatus: 'WAITING', + createdAt: '2023-11-09T14:59:51', + }, + }), + ) + }, + ), + rest.post( + `${baseUrl}${ApiEndPoint.postSuggestion('OFFER')}`, + async (_req, res, ctx) => { + return res( + ctx.status(200), + ctx.json({ + code: 'SUCCESS', + message: '성공하였습니다.', + data: { + suggestionId: 1, + suggestionType: 'OFFER', + fromCardId: 1, + toCardId: 3, + suggestionStatus: 'WAITING', + createdAt: '2023-11-09T14:59:51', + }, + }), + ) + }, + ), ] diff --git a/src/services/suggest/suggest.ts b/src/services/suggest/suggest.ts index 7c3ae033..9dafb6c6 100644 --- a/src/services/suggest/suggest.ts +++ b/src/services/suggest/suggest.ts @@ -1,9 +1,22 @@ import ApiEndPoint from '@/config/apiEndPoint' +import { SuggestionRequestData } from '@/types' import apiClient from '../apiClient' const getSuggestions = async (itemId: number) => { const response = await apiClient.get(ApiEndPoint.suggestions(itemId)) + return response.data.cardList +} + +const postSuggestion = async ({ + suggestionType, + fromCardId, + toCardId, +}: SuggestionRequestData) => { + const response = await apiClient.post( + ApiEndPoint.postSuggestion(suggestionType), + { fromCardId, toCardId }, + ) return response } -export { getSuggestions } +export { getSuggestions, postSuggestion } diff --git a/src/types/index.ts b/src/types/index.ts index 91825960..64bb096b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -47,7 +47,13 @@ export interface ItemSuggestion { cardTitle: string itemName: string priceRange: Category - suggestionType: 'poke' | 'offer' + suggestionType: 'POKE' | 'OFFER' + suggestionStatus: null | string } +export interface SuggestionRequestData { + suggestionType: string + fromCardId: number + toCardId: number +} export type { User } From 8f2812d54d508492452d46b4f441d335c3c60a75 Mon Sep 17 00:00:00 2001 From: juyeon-park Date: Sat, 11 Nov 2023 18:58:34 +0900 Subject: [PATCH 3/7] =?UTF-8?q?:tada:=20=EA=B1=B0=EB=9E=98=20=EC=A0=9C?= =?UTF-8?q?=EC=95=88=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/domain/card/suggest-card/SuggestCard.stories.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx b/src/components/domain/card/suggest-card/SuggestCard.stories.tsx index 30ada46c..79c8c2e7 100644 --- a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx +++ b/src/components/domain/card/suggest-card/SuggestCard.stories.tsx @@ -17,6 +17,7 @@ export const Normal: Story = { itemName: '에어팟 맥스', priceRange: '30만원대', suggestionType: '오퍼하기', + suggestionStatus: 'null', cardId: 1, toCardId: 3, }, @@ -27,6 +28,7 @@ export const Normal: Story = { itemName={'에어팟 맥스'} priceRange={'30만원대'} suggestionType={'OFFER'} + suggestionStatus={null} cardId={1} toCardId={3} /> From 34f4639fae698dc6620e9b25ee1d4120d6e9c07b Mon Sep 17 00:00:00 2001 From: juyeon-park Date: Sat, 11 Nov 2023 23:47:22 +0900 Subject: [PATCH 4/7] =?UTF-8?q?:bug:=20=EB=B2=84=EA=B7=B8=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/domain/card/suggest-card/SuggestCard.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx b/src/components/domain/card/suggest-card/SuggestCard.stories.tsx index 79c8c2e7..ec54530d 100644 --- a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx +++ b/src/components/domain/card/suggest-card/SuggestCard.stories.tsx @@ -17,7 +17,7 @@ export const Normal: Story = { itemName: '에어팟 맥스', priceRange: '30만원대', suggestionType: '오퍼하기', - suggestionStatus: 'null', + suggestionStatus: null, cardId: 1, toCardId: 3, }, From f4494cb9c88ed8368ba427d971b02a9e96378e7a Mon Sep 17 00:00:00 2001 From: juyeon-park Date: Sun, 12 Nov 2023 03:18:07 +0900 Subject: [PATCH 5/7] =?UTF-8?q?:bug:=20chromatic=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=EC=9D=84=20=EC=9C=84=ED=95=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../card/suggest-card/SuggestCard.stories.tsx | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/components/domain/card/suggest-card/SuggestCard.stories.tsx diff --git a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx b/src/components/domain/card/suggest-card/SuggestCard.stories.tsx deleted file mode 100644 index ec54530d..00000000 --- a/src/components/domain/card/suggest-card/SuggestCard.stories.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react' -import SuggestCard from './SuggestCard' - -const meta = { - title: 'DOMAIN/SuggestCard', - component: SuggestCard, - tags: ['autodocs'], - argTypes: {}, -} satisfies Meta - -export default meta -type Story = StoryObj - -export const Normal: Story = { - args: { - cardTitle: '에어팟 맥스 교환해요', - itemName: '에어팟 맥스', - priceRange: '30만원대', - suggestionType: '오퍼하기', - suggestionStatus: null, - cardId: 1, - toCardId: 3, - }, - render: () => { - return ( - - ) - }, -} From 556056b2159dc5dca5a9fde6690e44b7614f838b Mon Sep 17 00:00:00 2001 From: juyeon-park Date: Mon, 13 Nov 2023 15:05:51 +0900 Subject: [PATCH 6/7] =?UTF-8?q?:sparkles:=20=EB=B2=84=EA=B7=B8=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/apiEndPoint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/apiEndPoint.ts b/src/config/apiEndPoint.ts index 9c88e3c4..a26acd87 100644 --- a/src/config/apiEndPoint.ts +++ b/src/config/apiEndPoint.ts @@ -7,7 +7,7 @@ const ApiEndPoint = { items: (cursorId: number) => `/items?cursorId=${cursorId}`, myItems: (cursorId: number) => `/my-items?cursorId=${cursorId}`, dibs: (itemId: number) => `/dib/${itemId}`, - suggestions: (itemId: string) => `/${itemId}/available-cards`, + suggestions: (itemId: number) => `/${itemId}/available-cards`, suggestChecks: (cursorId: number) => `/suggest-checks?cursorId=${cursorId}`, putUserProfile: () => '/users/profile-image', putUserNickname: () => '/users/nickname', From b4a4aa0a57537825725a1acb1d43c47a94c879c9 Mon Sep 17 00:00:00 2001 From: juyeon-park Date: Mon, 13 Nov 2023 15:06:35 +0900 Subject: [PATCH 7/7] =?UTF-8?q?:bug:=20=EB=B9=8C=EB=93=9C=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/msw/mocks/suggestHandlers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/msw/mocks/suggestHandlers.ts b/src/lib/msw/mocks/suggestHandlers.ts index aa3b9497..1726cc3a 100644 --- a/src/lib/msw/mocks/suggestHandlers.ts +++ b/src/lib/msw/mocks/suggestHandlers.ts @@ -7,7 +7,7 @@ const baseUrl = Environment.apiAddress() export const suggestHandlers = [ rest.get( - `${baseUrl}${ApiEndPoint.suggestions('3')}`, + `${baseUrl}${ApiEndPoint.suggestions(3)}`, async (_req, res, ctx) => { return res( ctx.status(200),