Update useRouterQuery.ts

This commit is contained in:
zomars 2023-06-13 13:24:42 -07:00
parent 4b295a45d4
commit 63e3a2b789

View File

@ -26,9 +26,7 @@ export default function useRouterQuery<T extends string>(name: T) {
}
const setQuery = (newValue: string | number | null | undefined) => {
router.replace({ query: { ...router.query, [name]: newValue } }, undefined, {
shallow: true,
});
router.replace({ query: { ...router.query, [name]: newValue } }, undefined, { shallow: true });
router.replace({ query: { ...router.query, ...query, [name]: newValue } }, undefined, { shallow: true });
};