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) => {
|
||||
setData(data)
|
||||
})
|
||||
const querySearch = router.query.q ? decodeURIComponent(router.query.q) : ''
|
||||
setSearchTerm(querySearch)
|
||||
|
||||
router.replace(
|
||||
`${router.pathname.replace('.html', '')}${'?q='}${encodeURIComponent(
|
||||
querySearch
|
||||
)}`,
|
||||
`${router.asPath.replace('.html', '')}`,
|
||||
undefined,
|
||||
{ shallow: true }
|
||||
)
|
||||
const querySearch = router.query.q ? decodeURIComponent(router.query.q) : ''
|
||||
setSearchTerm(querySearch)
|
||||
})
|
||||
}, [])
|
||||
|
||||
if (data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue