From d32b1d08b00f3144e7438872b3e46d4ca9c0f774 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 23 Nov 2024 12:46:52 +0100 Subject: [PATCH] fix: don't override query params when updating query with request params --- frontend/src/composables/useData.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/composables/useData.ts b/frontend/src/composables/useData.ts index 210cfe495..5fffb2e4e 100644 --- a/frontend/src/composables/useData.ts +++ b/frontend/src/composables/useData.ts @@ -77,7 +77,8 @@ export function useProjects( () => false, ({ offset, limit, member, ...paramsWithoutLimit }) => { if (router) { - router.replace({ query: { page: offset && limit ? Math.floor(offset / limit) : undefined, ...paramsWithoutLimit } }); + const oldQuery = router.currentRoute.value.query; + router.replace({ query: { ...oldQuery, page: offset && limit ? Math.floor(offset / limit) : undefined, ...paramsWithoutLimit } }); } } ); @@ -308,7 +309,8 @@ export function useActionLogs( () => false, ({ offset, limit, ...paramsWithoutLimit }) => { if (router) { - router.replace({ query: { ...paramsWithoutLimit } }); + const oldQuery = router.currentRoute.value.query; + router.replace({ query: { ...oldQuery, ...paramsWithoutLimit } }); } } ); @@ -400,7 +402,8 @@ export function useProjectVersions( ({ data }) => { const { offset, limit, channel, platform } = data; if (router) { - router.replace({ query: { page: offset && limit ? Math.floor(offset / limit) : undefined, channel, platform } }); + const oldQuery = router.currentRoute.value.query; + router.replace({ query: { ...oldQuery, page: offset && limit ? Math.floor(offset / limit) : undefined, channel, platform } }); } } );