mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-02-11 14:52:01 +08:00
fix: don't override query params when updating query with request params
This commit is contained in:
parent
149e4c158a
commit
d32b1d08b0
@ -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 } });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user