fix: back url (#5414)
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/5425/head^2
parent
6d42fdb71c
commit
4b532646cb
|
@ -57,10 +57,13 @@ const goto = (router: NextRouter, searchParams: Record<string, string>) => {
|
|||
};
|
||||
|
||||
const removeQueryParams = (router: NextRouter, queryParams: string[]) => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
|
||||
queryParams.forEach((param) => {
|
||||
delete router.query[param];
|
||||
params.delete(param);
|
||||
});
|
||||
router.push(`${router.asPath.split("?")[0]}?${router.query.toString()}`);
|
||||
|
||||
router.push(`${router.asPath.split("?")[0]}?${params.toString()}`);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue