More skelton loader, add optional parameters to /locations and /events

This commit is contained in:
2024-10-04 15:20:40 +02:00
parent 0cf0c6be76
commit e0a8748184
16 changed files with 106 additions and 48 deletions

View File

@@ -1,6 +1,6 @@
import axios from "axios"
let BASE_URL = "http://localhost:3000/locations"
const BASE_URL = "http://localhost:3000/locations"
export async function getAllLocations() {
return await axios.get(BASE_URL)
@@ -8,4 +8,10 @@ export async function getAllLocations() {
export async function getLocation(locationName: string) {
return await axios.get(BASE_URL + "/" + locationName)
}
export async function getTopLocations(nrOfLocations: number) {
let url = BASE_URL + "?sort=desc&count=" + nrOfLocations
return await axios.get(url)
}