Skip to content

Commit

Permalink
Merge pull request #168 from jirum-alarm/fix/167/home-push-page
Browse files Browse the repository at this point in the history
[fix] ํ™ˆ ํ™”๋ฉด ์นดํ…Œ๊ณ ๋ฆฌ ๋ณ€๊ฒฝ์‹œ์— ์ƒˆ๋กœ๊ณ ์นจ ๋˜๋Š” ๋ฌธ์ œ ์ˆ˜์ •
  • Loading branch information
tolluset committed Feb 29, 2024
2 parents 7d78fe2 + e2141fd commit 117e310
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/(home)/hooks/useProductListViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { IProductOutput } from '@/graphql/interface/product';
import { ICategoryOutput } from '@/graphql/interface/category';
import { useDevice } from '@/hooks/useDevice';
import { useQuery, useSuspenseQuery } from '@apollo/client';
import { useRouter, useSearchParams } from 'next/navigation';
import { useSearchParams } from 'next/navigation';
import { useEffect, useState } from 'react';
import { useInView } from 'react-intersection-observer';

const limit = 20;
const allCategory = { id: 0, name: '์ „์ฒด' };

export const useProductListViewModel = () => {
const router = useRouter();
const searchParams = useSearchParams();

const [hasNextData, setHasNextData] = useState(true);
Expand Down Expand Up @@ -51,7 +50,7 @@ export const useProductListViewModel = () => {
current.delete('categoryId');
}
const search = current.toString();
router.push(`/?${search}`);
history.pushState({}, '', '?' + search);
};

const fetchMoreProducts = () => {
Expand Down

0 comments on commit 117e310

Please sign in to comment.