kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
fix(search): fix pagination
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2457>environments/review-front-2157-bqy7y3/deployments/17707
rodzic
a26b29d434
commit
d8d3de23ca
|
@ -0,0 +1 @@
|
|||
Fix pagination on search page (#2134)
|
|
@ -31,7 +31,8 @@ syncRef(pageQuery, page, {
|
|||
transform: {
|
||||
ltr: (left) => +left,
|
||||
rtl: (right) => right.toString()
|
||||
}
|
||||
},
|
||||
direction: 'both'
|
||||
})
|
||||
|
||||
const q = useRouteQuery('q', '')
|
||||
|
@ -113,7 +114,7 @@ const currentType = computed(() => types.value.find(({ id }) => id === type.valu
|
|||
const axiosParams = computed(() => {
|
||||
const params = new URLSearchParams({
|
||||
q: query.value,
|
||||
page: page.value as unknown as string,
|
||||
page: pageQuery.value,
|
||||
page_size: paginateBy.value as unknown as string
|
||||
})
|
||||
|
||||
|
@ -171,10 +172,12 @@ const search = async () => {
|
|||
}
|
||||
|
||||
watch(type, () => {
|
||||
if (page.value === 1) return search()
|
||||
page.value = 1
|
||||
search()
|
||||
})
|
||||
|
||||
// NOTE: When we watch `page`, the `pageQuery` value is never updated for some reason
|
||||
watch(pageQuery, search)
|
||||
search()
|
||||
|
||||
const labels = computed(() => ({
|
||||
|
|
Ładowanie…
Reference in New Issue