Improve filterBar on eventsPage, improve API access from frontend
This commit is contained in:
@@ -2,6 +2,13 @@ import axios from "axios"
|
||||
|
||||
const BASE_URL = "http://localhost:3000/cities"
|
||||
|
||||
/**
|
||||
* @deprecated Use fetchAllCities
|
||||
*/
|
||||
export async function getAllCities() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function fetchAllCities() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -2,6 +2,13 @@ import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/genres"
|
||||
|
||||
/**
|
||||
* @deprecated Use fetchAllGenres()
|
||||
*/
|
||||
export async function getAllGenres() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function fetchAllGenres() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
@@ -6,5 +6,5 @@ let BASE_URL = "http://localhost:3000/tours"
|
||||
* Fetch all tours from API
|
||||
*/
|
||||
export async function getAllTours() {
|
||||
return await axios.get(BASE_URL)
|
||||
//return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user