From bb28024a59ee4a1ccdc6eb6e43a19d456a86bf62 Mon Sep 17 00:00:00 2001 From: devwqc Date: Sat, 20 Jul 2024 10:10:31 +0900 Subject: [PATCH 1/2] =?UTF-8?q?style:=20console.log=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Card/CardSlider/Recommended/index.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/common/Card/CardSlider/Recommended/index.tsx b/src/components/common/Card/CardSlider/Recommended/index.tsx index ba011fc1..e54bc076 100644 --- a/src/components/common/Card/CardSlider/Recommended/index.tsx +++ b/src/components/common/Card/CardSlider/Recommended/index.tsx @@ -41,9 +41,6 @@ export default function CardSliderRecommended({ title }: CardSliderRecommendedPr ...productsRecommendedQueries.queryOptions({ page: 1, pageSize: 8 }), }); - useEffect(() => { - console.log(products); - }, [products]); return ( From 32c4fbcb57c2d2e4b5a4a155b29c265313340524 Mon Sep 17 00:00:00 2001 From: devwqc Date: Sat, 20 Jul 2024 10:18:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?bug:=20ProductDetailPage=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20=EC=83=81=ED=92=88=20fetch=20=EB=B6=84=EA=B8=B0=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/products/[id]/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/products/[id]/index.tsx b/src/pages/products/[id]/index.tsx index 4b02ca6d..7a666029 100644 --- a/src/pages/products/[id]/index.tsx +++ b/src/pages/products/[id]/index.tsx @@ -2,7 +2,6 @@ import classNames from 'classnames/bind'; import { useEffect, useState } from 'react'; import { GetServerSidePropsContext } from 'next'; import { useRouter } from 'next/router'; -import axiosInstance from '@/apis/authAxiosInstance'; import CartButton from '@/components/common/Button/Cart'; import Header from '@/components/common/Layout/Header'; @@ -38,10 +37,13 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { let product; try { - const res = await httpClient().get(`/products/detail/${productId}`, { - headers: { Authorization: `Bearer ${accessToken}` }, - }); - product = res; + if (accessToken) { + product = await httpClient().get(`/products/detail/${productId}`, { + headers: { Authorization: `Bearer ${accessToken}` }, + }); + } else { + product = await httpClient().get(`/products/detail/${productId}`); + } } catch { return { notFound: true,