I am trying to remove the url param after function was completed, so it won't break the uix.
Here how it looks if param is not removed
http://localhost:1337/check?domain=fb.com&success=task&success=note .
I need it to look like this http://localhost:1337/check?domain=fb.com&success=task after every call.
Will be glad for help
window.location.search and parse it with URLSearchParams.getAll(name) to get all values of the parameter as an array.set(name, value)window.location to change the URL with toString()'s result (back as a string).const searchParams = new URLSearchParams(window.location.search);
const success = searchParams.getAll('success')
success.pop(); // ['task']
searchParams.set('success', success);
window.location.search = searchParams.toString();