Start moving data server handling from pinia store to server
This commit is contained in:
1 parent
2cbee721c7
commit
2b7e87a68d
27 files changed
+401
-215
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import axios from "axios"
|
||||
|
||||
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 += (genre.length > 0) ? "genre=" + genre : ""
|
||||
|
||||
console.log(url)
|
||||
return await axios.get(url)
|
||||
}
|
||||
Reference in new issue
Block a user