diff --git a/src/apis/fetchMainItems.ts b/src/apis/fetchMainItems.ts index b89ca34b..14f2ed31 100644 --- a/src/apis/fetchMainItems.ts +++ b/src/apis/fetchMainItems.ts @@ -1,17 +1,20 @@ import { LocaleItemsType, WeekendItem } from "./../types/saleSection"; -import { axiosInstance } from "@apis/axiosInstance"; -import { END_POINTS } from "@/constants/api"; +import { BASE_URL, END_POINTS } from "@/constants/api"; +import axios from "axios"; // 유저 정보를 불러오는 api입니다. export const fetchMainItem = async (): Promise< [LocaleItemsType, WeekendItem[]] > => { - const { data } = await axiosInstance.get( - END_POINTS.MAIN + + const { data } = await axios.get( + BASE_URL + + END_POINTS.MAIN + "?cityNames=서울&cityNames=강원&cityNames=부산&cityNames=제주&cityNames=경상&cityNames=전라", ); + const { weekend, ...locale } = data.data; const temp = weekend.content; + console.log([locale, temp], "locale, temp"); return [locale, temp]; }; diff --git a/src/main.tsx b/src/main.tsx index b2fe260a..4c32f2be 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -3,15 +3,15 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import ReactDOM from "react-dom/client"; import { RouterProvider } from "react-router-dom"; import { ThemeProvider } from "styled-components"; -import { worker } from "./mocks/broswer"; +// import { worker } from "./mocks/broswer"; import { router } from "./routes/router"; import { GlobalStyle } from "./styles/globalStyle"; import { theme } from "./styles/theme"; const queryClient = new QueryClient(); -if (process.env.NODE_ENV === "development") { - worker.start(); -} +// if (process.env.NODE_ENV === "development") { +// worker.start(); +// } ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/src/pages/homePage/Home.tsx b/src/pages/homePage/Home.tsx index d93d20e2..282c798c 100644 --- a/src/pages/homePage/Home.tsx +++ b/src/pages/homePage/Home.tsx @@ -23,7 +23,7 @@ const Home = () => { const localeEntries: [number, string, LocaleItem[]][] = Object.entries( localeProds, ) - .filter((v) => v[1] !== null) + .filter((v) => v[1].length !== 0) .map((v, i) => [i, v[0], v[1]]); const [localeAndHotel] = useState(localeEntries); diff --git a/src/pages/homePage/percentAnimator/PercentAnimator.tsx b/src/pages/homePage/percentAnimator/PercentAnimator.tsx index 81f73009..2a920999 100644 --- a/src/pages/homePage/percentAnimator/PercentAnimator.tsx +++ b/src/pages/homePage/percentAnimator/PercentAnimator.tsx @@ -13,7 +13,7 @@ const PercentAnimator = ({ {localeAndHotel.map( (item) => - item[2].length && ( + item[2].length !== 0 && ( {item[2][0]?.salePercentage === percent && ( diff --git a/src/pages/transferWritingPricePage/TransferWritingPrice.tsx b/src/pages/transferWritingPricePage/TransferWritingPrice.tsx index 2efbb818..b50497a5 100644 --- a/src/pages/transferWritingPricePage/TransferWritingPrice.tsx +++ b/src/pages/transferWritingPricePage/TransferWritingPrice.tsx @@ -67,7 +67,6 @@ const TransferWritingPrice = () => { if (!is2ndChecked) return false; // 2차 가격 설정하기 체크 안 한 경우 if (is2ndChecked && secondPrice && downTimeAfter) { - console.log(firstPrice, opt1, opt2, opt3, optFinal, "???"); return true; // 2차 가격 설정한 경우 } else if (is2ndChecked && !secondPrice && !downTimeAfter) { return false; // 2차 가격 체크했지만 아무것도 쓰지 않은 경우는 일단 가능 @@ -76,7 +75,6 @@ const TransferWritingPrice = () => { } else if (is2ndChecked && secondPrice && !downTimeAfter) { return false; // 2차 가격 체크하고 2차 시간 입력 안 하고 가격만 입력한 경우 } else if (!userData?.bank || !userData?.accountNumber) { - console.log("???"); return false; } }