Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/탠스택쿼리키
Browse files Browse the repository at this point in the history
  • Loading branch information
Seoin02 authored Jul 24, 2024
2 parents 383ba09 + 55208e9 commit abdab51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/components/common/Card/CardSlider/Recommended/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ export default function CardSliderRecommended({ title }: CardSliderRecommendedPr
...productsRecommendedQueries.queryOptions({ page: 1, pageSize: 8 }),
});

useEffect(() => {
console.log(products);
}, [products]);
return (
<CardSlider.Root>
<CardSlider.Header>
Expand Down
12 changes: 7 additions & 5 deletions src/pages/products/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit abdab51

Please sign in to comment.