| 1 |
export function addQueryObjectToUrl( |
| 2 |
urlObject: URL, |
| 3 |
queryParams: { [key: string]: any } |
| 4 |
) { |
| 5 |
Object.keys(queryParams).forEach(key => { |
| 6 |
urlObject.searchParams.append(key, queryParams[key]); |
| 7 |
}); |
| 8 |
} |
| 9 |
|
| 10 |
export function removeQueryParamFromLocation(key: string) { |
| 11 |
const location = new URL(window.location.href); |
| 12 |
location.searchParams.delete(key); |
| 13 |
window.history.replaceState(null, '', location.href); |
| 14 |
} |
| 15 |
|