Bugfix: Filter on band page changes visible bands on home page

This commit is contained in:
2025-08-31 11:47:56 +02:00
parent 2fd045c590
commit d730280876
2 changed files with 8 additions and 3 deletions

View File

@@ -39,8 +39,8 @@ watch(() => router.currentRoute.value.query, () => {
</v-row>
<v-row
v-else-if="bandStore.bands.length > 0"
v-for="band in bandStore.bands"
v-else-if="bandStore.filteredBands.length > 0"
v-for="band in bandStore.filteredBands"
>
<v-col>
<band-list-item

View File

@@ -12,6 +12,9 @@ export const useBandStore = defineStore("bandStore", {
/** All available bands */
bands: ref<Array<BandApiModel>>([]),
/** Available bands filtered by parameters */
filteredBands: ref<Array<BandApiModel>>([]),
/** All information about a single band */
band: ref<BandDetailsApiModel>(new BandDetailsApiModel()),
@@ -32,7 +35,9 @@ export const useBandStore = defineStore("bandStore", {
await fetchAllBands()
.then(result => {
this.bands = result.data.filter((band: BandApiModel) => {
this.bands = result.data
this.filteredBands = result.data.filter((band: BandApiModel) => {
if (genreStore.genre == null) {
return true
}