diff --git a/components/CourseList.vue b/components/CourseList.vue index a78eecf..9392fea 100644 --- a/components/CourseList.vue +++ b/components/CourseList.vue @@ -3,7 +3,7 @@ - + - + {{ id.toUpperCase() }} - {{ course.name }} + {{ course.name }} - + {{ isFavoriteCourse(id) ? 'mdi-heart' : 'mdi-heart-outline' }} @@ -51,16 +51,15 @@ export default { return this.$store.state.user.courses && this.$store.state.user.courses.includes(courseID) }, addToFavorites (courseID, add) { - const gameRef = doc(this.$db, `benutzer/${this.$auth.currentUser.uid}`) + const userRef = doc(this.$db, `benutzer/${this.$auth.currentUser.uid}`) - // Atomically add a new answer to the "player[ID]answers" array field. - updateDoc(gameRef, { + updateDoc(userRef, { kurse: add ? arrayUnion(courseID) : arrayRemove(courseID) }).then((empty) => { // Query execution was successful add ? this.$store.commit('addFavoriteCourse', courseID) : this.$store.commit('removeFavoriteCourse', courseID) }).catch((error) => { - // Failed to update the game; display error message + // Failed; display error message this.$toast({ content: error, color: 'error' }) }) } diff --git a/components/DemoInfoDialog.vue b/components/DemoInfoDialog.vue index b08d0f5..a638963 100644 --- a/components/DemoInfoDialog.vue +++ b/components/DemoInfoDialog.vue @@ -3,7 +3,7 @@