diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 0a55f0c..3074a33 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -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 ( <> - {getPageTitle(`'${searchParams.keyword}' 검색 결과`)} + {getPageTitle(`'${decodedKeyword}' 검색 결과`)}
- +