diff --git a/src/pages/categories/[categoryCode].tsx b/src/pages/categories/[categoryCode].tsx index 9c421053..65eeb7f0 100644 --- a/src/pages/categories/[categoryCode].tsx +++ b/src/pages/categories/[categoryCode].tsx @@ -11,7 +11,9 @@ import { PostSection, ResultHeader } from '@components' import type { SortOptionCodes, TradeTypeCodes } from '@types' import { find, removeNullish, toQueryString } from '@utils' -const DEFAULT_POST_PAGE_NUMBER = 8 +const DEFAULT_PER_PAGE = 8 +// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다 +const POSTS_COUNT_MOCK = 10 type CategoriesProps = { category?: string @@ -33,9 +35,6 @@ export const getServerSideProps: GetServerSideProps = async ({ } }) -// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다 -const POSTS_COUNT_MOCK = 10 - const Categories: NextPage = ({ category, sort, @@ -65,7 +64,7 @@ const Categories: NextPage = ({ const infinitePosts = useGetInfinitePostsQuery({ lastId: null, - limit: DEFAULT_POST_PAGE_NUMBER, + limit: DEFAULT_PER_PAGE, ...searchParams }) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 870d31a2..3144c422 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -7,6 +7,10 @@ import { ProductList } from '../components/home/ProductList' import { useGetInfinitePostsQuery } from '@apis/post' import { CategorySlider, HomeBanner } from '@components' +const DEFAULT_PER_PAGE = 8 +// TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다 +const POSTS_COUNTS_MOCK = 10 + const Home: NextPage = () => { const { data: postList, @@ -14,20 +18,17 @@ const Home: NextPage = () => { hasNextPage } = useGetInfinitePostsQuery({ lastId: null, - limit: 8 + limit: DEFAULT_PER_PAGE }) const router = useRouter() - // TODO: 포스트 전체 갯수 내려달라고 요청해놓았습니다 - const postsCount = 10 - return ( 새로운 상품 - {postsCount > 0 ? ( + {POSTS_COUNTS_MOCK > 0 ? (