Remove unnessessary brackets

This commit is contained in:
Stedoss 2022-11-01 20:21:09 +00:00
parent 70aa790c16
commit d17d9fd036

View File

@ -8,10 +8,9 @@ export class API {
let params = ""; let params = "";
params += ArrayToArrayUrlParams("categories", venueFilters?.categories.map((c) => c.name) ?? []); params += ArrayToArrayUrlParams("categories", venueFilters?.categories.map((c) => c.name) ?? []);
params += ArrayToArrayUrlParams("tags", venueFilters?.tags.map((v) => v.name) ?? [], params.length < 1); params += ArrayToArrayUrlParams("tags", venueFilters?.tags.map((v) => v.name) ?? [], params.length < 1);
params += venueFilters?.nameFilter ? `${(params.length < 1 ? "?" : "&")}search=${venueFilters.nameFilter}` : ""; params += venueFilters?.nameFilter ? `${params.length < 1 ? "?" : "&"}search=${venueFilters.nameFilter}` : "";
const response = await fetch(`${this.baseAPIUrl}/venue${params}`); const response = await fetch(`${this.baseAPIUrl}/venue${params}`);
console.log(`calling ${this.baseAPIUrl}/venue${params}`);
return await response.json(); return await response.json();
} }