Bugfix: Filter on band page changes visible bands on home page
This commit is contained in:
@@ -39,8 +39,8 @@ watch(() => router.currentRoute.value.query, () => {
|
|||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<v-row
|
<v-row
|
||||||
v-else-if="bandStore.bands.length > 0"
|
v-else-if="bandStore.filteredBands.length > 0"
|
||||||
v-for="band in bandStore.bands"
|
v-for="band in bandStore.filteredBands"
|
||||||
>
|
>
|
||||||
<v-col>
|
<v-col>
|
||||||
<band-list-item
|
<band-list-item
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ export const useBandStore = defineStore("bandStore", {
|
|||||||
/** All available bands */
|
/** All available bands */
|
||||||
bands: ref<Array<BandApiModel>>([]),
|
bands: ref<Array<BandApiModel>>([]),
|
||||||
|
|
||||||
|
/** Available bands filtered by parameters */
|
||||||
|
filteredBands: ref<Array<BandApiModel>>([]),
|
||||||
|
|
||||||
/** All information about a single band */
|
/** All information about a single band */
|
||||||
band: ref<BandDetailsApiModel>(new BandDetailsApiModel()),
|
band: ref<BandDetailsApiModel>(new BandDetailsApiModel()),
|
||||||
|
|
||||||
@@ -32,7 +35,9 @@ export const useBandStore = defineStore("bandStore", {
|
|||||||
|
|
||||||
await fetchAllBands()
|
await fetchAllBands()
|
||||||
.then(result => {
|
.then(result => {
|
||||||
this.bands = result.data.filter((band: BandApiModel) => {
|
this.bands = result.data
|
||||||
|
|
||||||
|
this.filteredBands = result.data.filter((band: BandApiModel) => {
|
||||||
if (genreStore.genre == null) {
|
if (genreStore.genre == null) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user