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>
This commit is contained in:
Nafees Nazik
2022-11-09 15:57:23 +00:00
committed by GitHub
co-authored by Carina Wollendorfer kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent 6d42fdb71c
commit 4b532646cb
+5 -2
View File
@@ -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()}`);
};
/**