Implement global search
This commit is contained in:
@@ -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)
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user