mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Final fix for search query in all questions
This commit is contained in:
@@ -21,16 +21,15 @@ export default function AllQuestions({ router }) {
|
|||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setData(data)
|
setData(data)
|
||||||
})
|
|
||||||
const querySearch = router.query.q ? decodeURIComponent(router.query.q) : ''
|
|
||||||
setSearchTerm(querySearch)
|
|
||||||
router.replace(
|
router.replace(
|
||||||
`${router.pathname.replace('.html', '')}${'?q='}${encodeURIComponent(
|
`${router.asPath.replace('.html', '')}`,
|
||||||
querySearch
|
|
||||||
)}`,
|
|
||||||
undefined,
|
undefined,
|
||||||
{ shallow: true }
|
{ shallow: true }
|
||||||
)
|
)
|
||||||
|
const querySearch = router.query.q ? decodeURIComponent(router.query.q) : ''
|
||||||
|
setSearchTerm(querySearch)
|
||||||
|
})
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
Reference in New Issue
Block a user