Browse Source

:bug: add where('is_current',true)

visuddhinanda 1 year ago
parent
commit
8e93829642
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Http/Api/CourseApi.php

+ 2 - 1
app/Http/Api/CourseApi.php

@@ -22,7 +22,8 @@ class CourseApi{
 
     public static function role($courseId,$userUid){
         $role = CourseMember::where('course_id',$courseId)
-                            ->where('user_id')
+                            ->where('user_id',$userUid)
+                            ->where('is_current',true)
                             ->value('role');
         return $role;
     }