From 750d8e40c45808851d6ad998328cf27c48970e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kemal=20Karako=C3=A7?= <42945832+KemalKrKX@users.noreply.github.com> Date: Fri, 6 Dec 2024 01:20:34 +0100 Subject: [PATCH] Revert courses.go --- dao/courses.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dao/courses.go b/dao/courses.go index afec2a770..73238727a 100644 --- a/dao/courses.go +++ b/dao/courses.go @@ -344,10 +344,7 @@ func (d coursesDao) DeleteCourse(course model.Course) { func (d coursesDao) IsUserEnrolledInCourse(user uint, course uint) (bool, error) { var nRows int64 var err error - if DB == nil { - return false, err - } - err = DB.Table("course_users").Where("user_id = ? AND course_id = ?", user, course).Count(&nRows).Error + err := DB.Table("course_users").Where("user_id = ? AND course_id = ?", user, course).Count(&nRows).Error if err != nil { return false, err }