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:
parent
373adb1597
commit
96a44e3171
1 changed files with 8 additions and 9 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue