Skip to content

Commit

Permalink
Revert "[#557] [도서 검색] 최근 검색어 api 요청 (#587)"
Browse files Browse the repository at this point in the history
This reverts commit 591e9a8.
  • Loading branch information
gxxrxn authored Aug 20, 2024
1 parent 1410139 commit 9011d9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 0 additions & 5 deletions src/apis/book/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ const bookAPI = {
publicApi.get<APIBestSellerRes>(
`/aladin-api?QueryType=Bestseller&Cover=Big`
),

storeRecentSearch: (queryKeyword: string) =>
publicApi.get(
`/service-api/books?page=1&pageSize=1&query=${queryKeyword}&isStoreRecent=true`
),
};

export default bookAPI;
10 changes: 2 additions & 8 deletions src/app/book/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { APIBook } from '@/types/book';

import useBookSearchQuery from '@/queries/book/useBookSearchQuery';
import { useRecentSearchListQuery } from '@/queries/book/useRecentSearchesQuery';
import bookAPI from '@/apis/book';

import SSRSafeSuspense from '@/components/SSRSafeSuspense';
import useDebounceValue from '@/hooks/useDebounce';
Expand Down Expand Up @@ -97,13 +96,8 @@ const BookSearchResult = ({ queryKeyword }: { queryKeyword: string }) => {
? bookSearchInfo.data.pages[0].totalCount
: 0;

const handleBookClick = async ({ bookId }: { bookId: APIBook['bookId'] }) => {
try {
await bookAPI.storeRecentSearch(queryKeyword);
router.push(`/book/${bookId}`);
} catch (error) {
console.error(error);
}
const handleBookClick = ({ bookId }: { bookId: APIBook['bookId'] }) => {
router.push(`/book/${bookId}`);
};

useEffect(() => {
Expand Down

0 comments on commit 9011d9e

Please sign in to comment.