Skip to content

Commit

Permalink
Revert courses.go
Browse files Browse the repository at this point in the history
  • Loading branch information
KemalKrKX authored Dec 5, 2024
1 parent 712dd90 commit 6514507
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions api/courses.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +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
if user != nil {
var err error
// todo: check if user is allowed to see the course
// -> Get full course from database
enrolled, err = r.CoursesDao.IsUserEnrolledInCourse(tumLiveContext.User.ID, course.ID)
if err != nil {
enrolled = false
}
// todo: check if user is allowed to see the course
// -> Get full course from database
enrolled, err := r.CoursesDao.IsUserEnrolledInCourse(tumLiveContext.User.ID, course.ID)
if err != nil {
enrolled = false
}

if course.Visibility == "enrolled" && !enrolled {
continue
}
Expand Down

0 comments on commit 6514507

Please sign in to comment.