Refactor frontend, display tours with cards on ToursPage
This commit is contained in:
11
software/src/data/api/bandApi.ts
Normal file
11
software/src/data/api/bandApi.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/bands"
|
||||
|
||||
export async function getAllBands() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function getOneBand(id: number) {
|
||||
return await axios.get(BASE_URL + '/' + id)
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import axios from "axios";
|
||||
|
||||
let BASE_URL = "http://localhost:3000/brands"
|
||||
|
||||
export async function getAllBrands() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/categories"
|
||||
|
||||
export async function getAllCategories() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
7
software/src/data/api/genreApi.ts
Normal file
7
software/src/data/api/genreApi.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/genres"
|
||||
|
||||
export async function getAllGenres() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
7
software/src/data/api/locationApi.ts
Normal file
7
software/src/data/api/locationApi.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/locations"
|
||||
|
||||
export async function getAllLocations() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/products"
|
||||
|
||||
/**
|
||||
* Fetch all products from API
|
||||
*/
|
||||
export async function getAllProducts() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
7
software/src/data/api/showApi.ts
Normal file
7
software/src/data/api/showApi.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/shows"
|
||||
|
||||
export async function getAllShows() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
10
software/src/data/api/tourApi.ts
Normal file
10
software/src/data/api/tourApi.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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