Skip to content

Commit

Permalink
Update courses.go
Browse files Browse the repository at this point in the history
  • Loading branch information
KemalKrKX authored Dec 5, 2024
1 parent f910853 commit 667e5f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/courses.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,12 @@ func (r coursesRoutes) getPinned(c *gin.Context) {
user := tumLiveContext.User
resp := make([]model.CourseDTO, 0, len(pinnedCourses))
for _, course := range pinnedCourses {
enrolled := false
var err error
// todo: check if user is allowed to see the course
// -> Get full course from database
if tumLiveContext.User != nil {
enrolled, err := r.CoursesDao.IsUserEnrolledInCourse(tumLiveContext.User.ID, course.ID)
enrolled, err = r.CoursesDao.IsUserEnrolledInCourse(tumLiveContext.User.ID, course.ID)
if err != nil {
enrolled = false
}
Expand Down

0 comments on commit 667e5f4

Please sign in to comment.