Streamlined stores
This commit is contained in:
@@ -6,10 +6,10 @@ export async function fetchAllBands() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function getBand(bandName: string) {
|
||||
export async function fetchBandByName(bandName: string) {
|
||||
return await axios.get(BASE_URL + '/band/' + bandName)
|
||||
}
|
||||
|
||||
export async function searchBand(searchTerm: string) {
|
||||
export async function fetchBandsBySearchTerm(searchTerm: string) {
|
||||
return await axios.get(BASE_URL + '/search?value=' + searchTerm)
|
||||
}
|
||||
@@ -2,13 +2,6 @@ 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)
|
||||
}
|
||||
@@ -2,11 +2,11 @@ import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/concerts"
|
||||
|
||||
export async function fetchConcerts() {
|
||||
export async function fetchAllConcerts() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function fetchConcert(id: number) {
|
||||
export async function fetchConcertById(id: number) {
|
||||
if (id != undefined) {
|
||||
return await axios.get(BASE_URL + "/concert/" + id)
|
||||
} else {
|
||||
@@ -27,6 +27,6 @@ export async function fetchUpcomingConcerts(nrOfConcerts: number) {
|
||||
return await axios.get(url)
|
||||
}
|
||||
|
||||
export async function searchConcert(searchTerm: string) {
|
||||
export async function fetchConcertsBySearchTerm(searchTerm: string) {
|
||||
return await axios.get(BASE_URL + '/search?value=' + searchTerm)
|
||||
}
|
||||
@@ -2,13 +2,6 @@ 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,7 +6,7 @@ export async function fetchAllLocations() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function getLocation(locationName: string) {
|
||||
export async function fetchLocationByName(locationName: string) {
|
||||
return await axios.get(BASE_URL + "/location/" + locationName)
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ export async function fetchTopLocations(nrOfLocations: number) {
|
||||
return await axios.get(url)
|
||||
}
|
||||
|
||||
export async function searchLocation(searchTerm: string) {
|
||||
export async function fetchLocationsBySearchTerm(searchTerm: string) {
|
||||
return await axios.get(BASE_URL + "/search?value=" + searchTerm)
|
||||
}
|
||||
@@ -2,9 +2,8 @@ import axios from "axios"
|
||||
|
||||
const BASE_URL = "http://localhost:3000/api"
|
||||
|
||||
export function getServerState() {
|
||||
export function fetchServerState() {
|
||||
return axios.get(BASE_URL)
|
||||
|
||||
}
|
||||
|
||||
export function resetDatabase() {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { BasketItemModel } from "../models/ordering/basketItemModel"
|
||||
|
||||
const BASE_URL = "http://localhost:3000/orders"
|
||||
|
||||
export async function getUserOrders(userId: number) {
|
||||
export async function fetchUserOrders(userId: number) {
|
||||
return axios.get(BASE_URL + "/" + userId)
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ export async function createOrder(
|
||||
}
|
||||
}
|
||||
|
||||
console.log(tickets)
|
||||
|
||||
return axios.post(BASE_URL, {
|
||||
accountId: accountId,
|
||||
tickets: tickets,
|
||||
|
||||
Reference in New Issue
Block a user