Skip to content

Commit

Permalink
fix: don't override query params when updating query with request params
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Nov 23, 2024
1 parent 149e4c1 commit d32b1d0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/composables/useData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } });
}
}
);
Expand Down Expand Up @@ -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 } });
}
}
);
Expand Down Expand Up @@ -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 } });
}
}
);
Expand Down

0 comments on commit d32b1d0

Please sign in to comment.