Add dynamic course page

This commit is contained in:
2022-10-22 13:06:42 +02:00
parent 9f64615348
commit b7599b7d56
2 changed files with 55 additions and 1 deletions

View File

@@ -1,10 +1,14 @@
export const state = () => ({
firebaseInitialized: false,
userLoggedIn: false,
courses: []
courses: {},
selectedCourse: undefined
})
export const getters = {
getCourseByID: (state) => (courseID) => {
return state.courses[courseID]
}
}
export const mutations = {
@@ -16,6 +20,9 @@ export const mutations = {
},
setCourses (state, courses) {
state.courses = courses
},
setSelectedCourse (state, courseID) {
state.selectedCourse = courseID
}
}