Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 도서 검색 리다이렉트시 URI 인코딩 추가 #575

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/component/utils/BookSearchPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const BookSearchPreview = ({
</Paginations.Root>
<Link
className="search-preview__more"
to={`/search?search=${encodeURI(keyword)}`}
to={`/search?search=${encodeURIComponent(keyword)}`}
>
{!isLoading && totalCount ? (
<EmphasisInString
Expand Down
6 changes: 4 additions & 2 deletions src/component/utils/SearchRankingList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentProps, useState } from "react";
import { ComponentProps, useEffect, useState } from "react";
import { type SearchKeyword } from "~/type/SearchKeyword";
import Carousel from "./Carousel";
import SearchRankingItem from "./SearchRankingItem";
Expand Down Expand Up @@ -33,7 +33,9 @@ const SearchRankingList = ({ list }: Props) => {
<Image src={ToggleDownArrow} alt="인기검색어 닫기" />
</p>
{list.map(item => (
<Link to={`search?search=${item.searchKeyword}`}>
<Link
to={`search?search=${encodeURIComponent(item.searchKeyword)}`}
>
<SearchRankingItem key={item.id} item={item} height={HEIGHT} />
</Link>
))}
Expand Down
Loading