diff --git a/src/pages/allQuestions.js b/src/pages/allQuestions.js index a9bcb14..102d69c 100644 --- a/src/pages/allQuestions.js +++ b/src/pages/allQuestions.js @@ -21,13 +21,13 @@ export default function AllQuestions({ router }) { }) .then((data) => { setData(data) - - router.replace( - `${router.asPath.replace('.html', '')}`, - undefined, - { shallow: true } - ) - const querySearch = router.query.q ? decodeURIComponent(router.query.q) : '' + + router.replace(`${router.asPath.replace('.html', '')}`, undefined, { + shallow: true, + }) + const querySearch = router.query.question + ? decodeURIComponent(router.query.question) + : '' setSearchTerm(querySearch) }) }, [])