When I'm trying to append an id to the end of my query string, the JS adds unnecessary ampersand and '=' sign to the query string.
I'm trying to go for something like this:
http://sample_site/report/file/list?f%5B%5D=1111
but I get this when I view the result in the console:
http://sample_site/report/file/list?f%5B%5D=&f=1111
Here is my JS function that builds a URL object:
buildTileFilter(){
let url = new URL('http://sample_site/report/file/list?f%5B%5D');
let query_string = url.search;
let search_params = new URLSearchParams(query_string);
search_params.set('f', 1111);
url.search = search_params.toString();
let new_url = url.toString();
return new_url;
}