Formating code, changed query param "q" to "question"

This commit is contained in:
mrfry 2020-11-07 14:36:33 +01:00
parent 96a44e3171
commit 0906bdb253

View file

@ -21,13 +21,13 @@ export default function AllQuestions({ router }) {
}) })
.then((data) => { .then((data) => {
setData(data) setData(data)
router.replace( router.replace(`${router.asPath.replace('.html', '')}`, undefined, {
`${router.asPath.replace('.html', '')}`, shallow: true,
undefined, })
{ shallow: true } const querySearch = router.query.question
) ? decodeURIComponent(router.query.question)
const querySearch = router.query.q ? decodeURIComponent(router.query.q) : '' : ''
setSearchTerm(querySearch) setSearchTerm(querySearch)
}) })
}, []) }, [])