diff --git a/src/apis/api/getPoll.tsx b/src/apis/api/getPoll.tsx index 9681d99..787e31b 100644 --- a/src/apis/api/getPoll.tsx +++ b/src/apis/api/getPoll.tsx @@ -1,7 +1,11 @@ import { axiosInstance } from 'apis/base/instance'; -const getPoll = async (roomId: string | undefined) => { - const response = await axiosInstance.get(`/${roomId}`); +interface PollParams { + roomId: string | undefined; +} + +const getPoll = async ({ roomId }: PollParams) => { + const response = await axiosInstance.get(`/api/v1/${roomId}`); return response; }; diff --git a/src/apis/api/getResult.tsx b/src/apis/api/getResult.tsx index 45076b2..999e26d 100644 --- a/src/apis/api/getResult.tsx +++ b/src/apis/api/getResult.tsx @@ -1,8 +1,12 @@ import { axiosInstance } from 'apis/base/instance'; -const getResult = async (roomId: string | any) => { - const response = await axiosInstance.get(`/${roomId}/result`); +interface ResultParams { + roomId: string | undefined; +} + +const getResult = async ({ roomId }: ResultParams) => { + const response = await axiosInstance.get(`/api/v1/${roomId}/result`); return response; }; -export { getResult }; +export default getResult; diff --git a/src/apis/api/postRandomListApi.tsx b/src/apis/api/postRandomListApi.tsx index 5d0e53b..a89bf04 100644 --- a/src/apis/api/postRandomListApi.tsx +++ b/src/apis/api/postRandomListApi.tsx @@ -6,7 +6,7 @@ interface RandomListApiParams { } const postRandomListApi = async ({ longitude, latitude }: RandomListApiParams) => { - const response = await axiosInstance.post('/create', { + const response = await axiosInstance.post('/api/v1/create', { longitude, latitude, }); diff --git a/src/apis/api/postResuggestOneApi.tsx b/src/apis/api/postResuggestOneApi.tsx index b59f20e..c328b70 100644 --- a/src/apis/api/postResuggestOneApi.tsx +++ b/src/apis/api/postResuggestOneApi.tsx @@ -1,12 +1,12 @@ import { axiosInstance } from 'apis/base/instance'; -interface ResuggestProps { - roomId: number; - restaurantId: number; +interface ResuggestParams { + roomId: string; + restaurantId: string; } -const postResuggestOneApi = async ({ roomId, restaurantId }: ResuggestProps) => { - const response = await axiosInstance.post(`/${roomId}/resuggest/${restaurantId}`); +const postResuggestOneApi = async ({ roomId, restaurantId }: ResuggestParams) => { + const response = await axiosInstance.post(`/api/v1/${roomId}/resuggest/${restaurantId}`); return response.data; }; diff --git a/src/apis/api/postRetryApi.tsx b/src/apis/api/postRetryApi.tsx index 97c02ba..3c67e58 100644 --- a/src/apis/api/postRetryApi.tsx +++ b/src/apis/api/postRetryApi.tsx @@ -1,7 +1,11 @@ import { axiosInstance } from 'apis/base/instance'; -const postRetryApi = async (roomId: number) => { - const response = await axiosInstance.post(`/retry/${roomId}`); +interface RetryApiParams { + roomId: string; +} + +const postRetryApi = async ({ roomId }: RetryApiParams) => { + const response = await axiosInstance.post(`/api/v1/resuggest/${roomId}`); return response.data; }; diff --git a/src/apis/api/postVoteApi.tsx b/src/apis/api/postVoteApi.tsx index f48a40a..edcb49c 100644 --- a/src/apis/api/postVoteApi.tsx +++ b/src/apis/api/postVoteApi.tsx @@ -6,7 +6,7 @@ interface VoteApiParams { } const postVoteApi = async ({ roomId, voteList }: VoteApiParams) => { - const response = await axiosInstance.post(`${roomId}/vote`, { restaurantIdList: voteList }); + const response = await axiosInstance.post(`/api/v1/${roomId}/vote`, { restaurantIdList: voteList }); return response.data; }; diff --git a/src/apis/query/useGetResult.tsx b/src/apis/query/useGetResult.tsx index 8582fec..ec07f2e 100644 --- a/src/apis/query/useGetResult.tsx +++ b/src/apis/query/useGetResult.tsx @@ -1,6 +1,6 @@ import { useRef } from 'react'; import { useQuery } from '@tanstack/react-query'; -import { getResult } from 'apis/api/getResult'; +import getResult from 'apis/api/getResult'; const useGetResult = (roomId: string | undefined) => { const isFirstRun = useRef(true); @@ -10,7 +10,7 @@ const useGetResult = (roomId: string | undefined) => { await new Promise((resolve) => setTimeout(resolve, 3000)); isFirstRun.current = false; } - return getResult(roomId); + return getResult({ roomId }); }; const { data: voteOverallResultData, refetch } = useQuery({ diff --git a/src/apis/query/useGetRoom.tsx b/src/apis/query/useGetRoom.tsx index 89fe215..e6172dc 100644 --- a/src/apis/query/useGetRoom.tsx +++ b/src/apis/query/useGetRoom.tsx @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import getPoll from 'apis/api/getPoll'; export const useGetRoom = (roomId: string | undefined) => { - const { data, isLoading, isError } = useQuery({ queryKey: ['room', roomId], queryFn: () => getPoll(roomId) }); + const { data, isLoading, isError } = useQuery({ queryKey: ['room', roomId], queryFn: () => getPoll({ roomId }) }); return { data, diff --git a/src/components/common/MenuCard/MenuCard.styled.ts b/src/components/common/MenuCard/MenuCard.styled.ts index 65424b8..a3a2146 100644 --- a/src/components/common/MenuCard/MenuCard.styled.ts +++ b/src/components/common/MenuCard/MenuCard.styled.ts @@ -21,7 +21,7 @@ export const RestaurantName = styled.strong` font-size: var(--md); `; -export const RestaurantLink = styled.img` +export const RestaurantLinkImg = styled.img` display: inline-block; `; diff --git a/src/components/common/MenuCard/MenuCard.tsx b/src/components/common/MenuCard/MenuCard.tsx index e7da8a3..395d07c 100644 --- a/src/components/common/MenuCard/MenuCard.tsx +++ b/src/components/common/MenuCard/MenuCard.tsx @@ -59,7 +59,7 @@ const MenuCard = (props: MenuCardProps) => {
{title} - + {categories.map((category, i) => ( diff --git a/src/pages/OverallRanking/OverallRanking.styled.ts b/src/pages/OverallRanking/OverallRanking.styled.ts index a20fb19..966d99b 100644 --- a/src/pages/OverallRanking/OverallRanking.styled.ts +++ b/src/pages/OverallRanking/OverallRanking.styled.ts @@ -10,8 +10,9 @@ export const OverallRankingWrapper = styled.div` padding: 45px 19px 43px; display: flex; flex-direction: column; - height: 100%; + justify-content: space-between; gap: 25px; + height: 100vh; .page-title { margin-bottom: 3px; @@ -97,7 +98,6 @@ export const Distance = styled.p` export const ButtonLayout = styled.div` display: flex; flex-direction: column; - height: 100%; flex-grow: 1; `; @@ -115,7 +115,3 @@ export const ButtonShare = styled.button` vertical-align: bottom; } `; - -export const RetryButtonLayout = styled.div` - margin-top: 12px; -`; diff --git a/src/pages/OverallRanking/OverallRanking.tsx b/src/pages/OverallRanking/OverallRanking.tsx index 05fcbc9..837ee3c 100644 --- a/src/pages/OverallRanking/OverallRanking.tsx +++ b/src/pages/OverallRanking/OverallRanking.tsx @@ -103,16 +103,14 @@ function OverallRanking() { ))} - - - share result icon - 공유하기 - - - - - + + share result icon + 공유하기 + + + + {/* 모달은 포탈 써서 전역으로 나중에 바꿀게요!! */} diff --git a/src/pages/RandomList/RandomList.tsx b/src/pages/RandomList/RandomList.tsx index 546fbe7..3e69bac 100644 --- a/src/pages/RandomList/RandomList.tsx +++ b/src/pages/RandomList/RandomList.tsx @@ -46,7 +46,7 @@ const RandomList = () => { category: 'click', action: '투표공유하기_버튼', label: '음식점 추천 화면', - value: roomId, + value: Number(roomId), }); } navigate(`/random-menu/${roomId}`); @@ -58,7 +58,7 @@ const RandomList = () => { setIsAlertModalOn(false); }; - const handleClick = (restaurantId: number, index: number) => { + const handleClick = (restaurantId: string, index: number) => { ReactGA.event({ category: 'click', action: '마이너스_버튼', @@ -69,7 +69,7 @@ const RandomList = () => { if (prev) { const updatedList = [...prev]; updatedList.splice(index, 1); - updatedList.push(data); + updatedList.push(data.restaurantResList[4]); return updatedList; } return prev; @@ -91,7 +91,7 @@ const RandomList = () => { label: '음식점 추천 화면', }); if (roomId) { - retryMutate(roomId, { onSuccess: retryOnSuccess }); + retryMutate({ roomId }, { onSuccess: retryOnSuccess }); } }; diff --git a/src/recoil/roomIdData.ts b/src/recoil/roomIdData.ts index 5bde07a..488763f 100644 --- a/src/recoil/roomIdData.ts +++ b/src/recoil/roomIdData.ts @@ -6,7 +6,7 @@ const { persistAtom } = recoilPersist({ storage: sessionStorage, }); -export const roomIdData = atom({ +export const roomIdData = atom({ key: 'roomIdData', default: null, effects_UNSTABLE: [persistAtom],