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
Nafees Nazik 2022-11-09 21:27:23 +05:30 committed by GitHub
parent 6d42fdb71c
commit 4b532646cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

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()}`);
};
/**