melhorias

This commit is contained in:
Luiz Silva 2024-09-15 13:58:38 -03:00
parent 7fae4d43e5
commit 97184ef169
5 changed files with 9 additions and 7 deletions

View file

@ -49,7 +49,8 @@ class TipagemRotas {
endereco(query, usarComoHash) {
const url = new URL(typeof window !== "undefined" ? window.location.href : "http://localhost");
url.pathname = this.caminho;
const queryKeys = typeof query == "object" && query ? Object.entries(query) : [[query, ""]];
url.search = "";
const queryKeys = Object.entries(query);
for (const [key, value] of queryKeys) {
url.searchParams.set(String(key), value);
}