Skeleton loader

This commit is contained in:
2024-10-04 13:16:05 +02:00
parent 17e6b08129
commit e2f6fb9c52
20 changed files with 458 additions and 286 deletions

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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>
}

View File

@@ -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

View File

@@ -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
})
}
}