Skeleton loader
This commit is contained in:
@@ -6,6 +6,6 @@ export async function getAllBands() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function getOneBand(id: number) {
|
||||
return await axios.get(BASE_URL + '/' + id)
|
||||
export async function getBand(bandName: string) {
|
||||
return await axios.get(BASE_URL + '/' + bandName)
|
||||
}
|
||||
@@ -4,4 +4,8 @@ let BASE_URL = "http://localhost:3000/locations"
|
||||
|
||||
export async function getAllLocations() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
export async function getLocation(locationName: string) {
|
||||
return await axios.get(BASE_URL + "/" + locationName)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EventModel } from "./eventModel"
|
||||
import { RatingModel } from "./ratingModel"
|
||||
import { TourModel } from "./tourModel"
|
||||
|
||||
export class BandModel {
|
||||
id: number
|
||||
@@ -18,5 +18,5 @@ export class BandModel {
|
||||
genres: Array<{
|
||||
name: string
|
||||
}>
|
||||
tours: Array<TourModel>
|
||||
events: Array<EventModel>
|
||||
}
|
||||
@@ -12,13 +12,13 @@ export class LocationModel {
|
||||
city: {
|
||||
name: string
|
||||
country: string
|
||||
}
|
||||
} = { name: "", country: "" }
|
||||
concerts: Array<{
|
||||
id: number
|
||||
date: string
|
||||
price: number
|
||||
inStock: number
|
||||
tour: {
|
||||
event: {
|
||||
name: string
|
||||
offered: boolean
|
||||
image: string
|
||||
|
||||
@@ -33,16 +33,24 @@ export const useShoppingStore = defineStore("shoppingStore", {
|
||||
},
|
||||
|
||||
async getCities() {
|
||||
const feedbackStore = useFeedbackStore()
|
||||
feedbackStore.fetchDataFromServerInProgress = true
|
||||
|
||||
await fetchAllCities()
|
||||
.then(result => {
|
||||
this.cities = result.data
|
||||
feedbackStore.fetchDataFromServerInProgress = false
|
||||
})
|
||||
},
|
||||
|
||||
async getGenres() {
|
||||
const feedbackStore = useFeedbackStore()
|
||||
feedbackStore.fetchDataFromServerInProgress = true
|
||||
|
||||
await fetchAllGenres()
|
||||
.then(result => {
|
||||
this.genres = result.data
|
||||
feedbackStore.fetchDataFromServerInProgress = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user