Exercise 3.1 fully implemented

This commit is contained in:
2024-11-20 12:27:41 +01:00
parent cfc466b92e
commit 5eab947b8c
5 changed files with 34 additions and 16 deletions

View File

@@ -33,16 +33,14 @@ export const useBandStore = defineStore("bandStore", {
await fetchAllBands()
.then(result => {
this.bands = result.data.filter((band: BandApiModel) => {
if (genreStore.filteredGenres.length == 0) {
if (genreStore.genre == null) {
return true
}
for (let bandGenre of band.genres) {
for (let filteredGenres of genreStore.filteredGenres) {
if (bandGenre.name == filteredGenres.name) {
if (bandGenre.name == genreStore.genre.name) {
return true
}
}
}
return false