Implement global search

This commit is contained in:
2024-10-11 12:59:21 +02:00
parent 49b436d588
commit cfb8fb9d7d
24 changed files with 262 additions and 209 deletions

View File

@@ -7,5 +7,9 @@ export async function getAllBands() {
}
export async function getBand(bandName: string) {
return await axios.get(BASE_URL + '/' + bandName)
return await axios.get(BASE_URL + '/band/' + bandName)
}
export async function searchBand(searchTerm: string) {
return await axios.get(BASE_URL + '/search?value=' + searchTerm)
}

View File

@@ -2,13 +2,9 @@ import axios from "axios"
let BASE_URL = "http://localhost:3000/concerts"
export async function getAllConcerts() {
return await axios.get(BASE_URL)
}
export async function getConcert(id: number) {
if (id != undefined) {
return await axios.get(BASE_URL + "/" + id)
return await axios.get(BASE_URL + "/concert/" + id)
} else {
return null
}

View File

@@ -14,4 +14,8 @@ export async function getTopEvents(nrOfEvents) {
let url = BASE_URL + "?sort=desc&count=" + nrOfEvents
return await axios.get(url)
}
export async function searchEvent(searchTerm: string) {
return await axios.get(BASE_URL + "/search?value=" + searchTerm)
}

View File

@@ -7,11 +7,15 @@ export async function getAllLocations() {
}
export async function getLocation(locationName: string) {
return await axios.get(BASE_URL + "/" + locationName)
return await axios.get(BASE_URL + "/location/" + locationName)
}
export async function getTopLocations(nrOfLocations: number) {
let url = BASE_URL + "?sort=desc&count=" + nrOfLocations
return await axios.get(url)
}
export async function searchLocation(searchTerm: string) {
return await axios.get(BASE_URL + "/search?value=" + searchTerm)
}

View File

@@ -1,10 +0,0 @@
import axios from "axios"
let BASE_URL = "http://localhost:3000/tours"
/**
* Fetch all tours from API
*/
export async function getAllTours() {
//return await axios.get(BASE_URL)
}