Skip to content

Commit

Permalink
[SWM-363] Fix : decodeURIcomponent
Browse files Browse the repository at this point in the history
  • Loading branch information
oikkoikk committed Oct 25, 2023
1 parent 31da636 commit e0f33c2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,24 @@ export default function SearchResults({ searchParams }: Props) {
]) as LectureRecommendations;

const requestParam: SearchLectureParams = {
keyword:
searchParams.keyword === undefined
? ''
: decodeURIComponent(searchParams.keyword),
keyword: searchParams.keyword ?? '',
limit: searchParams.limit ? Number(searchParams.limit) : LIMIT_PER_FETCH,
next_page_token: '',
filter: searchParams.filter ? searchParams.filter : 'all'
};

const decodedKeyword = decodeURIComponent(requestParam.keyword);

useLayoutEffect(() => {
window.scrollTo({ top: 0 });
}, []);

return (
<>
<title>{getPageTitle(`'${searchParams.keyword}' 검색 결과`)}</title>
<title>{getPageTitle(`'${decodedKeyword}' 검색 결과`)}</title>
<div className='py-20 bg-sroom-gray-200'>
<section className='max-w-screen-xl px-4 mx-auto lg:px-24'>
<SearchResultsHeading keyword={requestParam.keyword} />
<SearchResultsHeading keyword={decodedKeyword} />
<Suspense
fallback={
<SearchResultsSkeleton
Expand Down

0 comments on commit e0f33c2

Please sign in to comment.