Loading feedback with indeterminate circle

This commit is contained in:
2024-10-03 20:19:03 +02:00
parent c611cc04fc
commit ed4fa90f75
4 changed files with 21 additions and 7 deletions

View File

@@ -6,24 +6,29 @@ import { fetchAllCities } from "../api/cityApi";
import { CityModel } from "../models/locations/cityModel";
import { GenreModel } from "../models/acts/genreModel";
import { fetchAllGenres } from "../api/genreApi";
import { useFeedbackStore } from "./feedbackStore";
export const useShoppingStore = defineStore("shoppingStore", {
state: () => ({
events: ref<Array<EventModel>>([ new EventModel() ]),
cities: ref<Array<CityModel>>([ new CityModel() ]),
genres: ref<Array<GenreModel>>([ new GenreModel() ]),
events: ref<Array<EventModel>>([]),
cities: ref<Array<CityModel>>([]),
genres: ref<Array<GenreModel>>([]),
cityFilterName: ref<String>(),
genreFilterName: ref<String>()
}),
actions: {
async getEvents() {
const feedbackStore = useFeedbackStore()
feedbackStore.fetchDataFromServerInProgress = true
await fetchEvents(
this.cityFilterName != null ? this.cityFilterName : "",
this.genreFilterName != null ? this.genreFilterName : ""
)
.then(result => {
this.events = result.data
feedbackStore.fetchDataFromServerInProgress = false
})
},