Improve filterBar on eventsPage, improve API access from frontend

This commit is contained in:
2024-10-03 19:56:44 +02:00
parent 14766fb39b
commit 67ed71858c
27 changed files with 170 additions and 164 deletions

View File

@@ -4,9 +4,8 @@ const BASE_URL = "http://localhost:3000/events"
export async function fetchEvents(city: string = "", genre: string = "") {
let url = BASE_URL + "?"
url += (city.length > 0) ? "city=" + city : ""
url += (city.length > 0) ? "city=" + city + "&" : ""
url += (genre.length > 0) ? "genre=" + genre : ""
console.log(url)
return await axios.get(url)
}