Fixed Account pages
This commit is contained in:
35
software/src/stores/bandStore.ts
Normal file
35
software/src/stores/bandStore.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { BandApiModel } from "../data/models/acts/bandApiModel";
|
||||
import { fetchAllBands, getBand } from "../data/api/bandApi";
|
||||
import { BandDetailsApiModel } from "../data/models/acts/bandDetailsApiModel";
|
||||
|
||||
export const useBandStore = defineStore("bandStore", {
|
||||
state: () => ({
|
||||
bands: ref<Array<BandApiModel>>([]),
|
||||
band: ref<BandDetailsApiModel>(new BandDetailsApiModel()),
|
||||
fetchInProgress: ref(false)
|
||||
}),
|
||||
|
||||
actions: {
|
||||
async getBands() {
|
||||
this.fetchInProgress = true
|
||||
|
||||
fetchAllBands()
|
||||
.then(result => {
|
||||
this.bands = result.data
|
||||
this.fetchInProgress = false
|
||||
})
|
||||
},
|
||||
|
||||
async getBand(name: string) {
|
||||
this.fetchInProgress = true
|
||||
|
||||
getBand(name)
|
||||
.then(result => {
|
||||
this.band = result.data
|
||||
this.fetchInProgress = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user