Browse Source

getById ->getByUuid

visuddhinanda 2 years ago
parent
commit
3d101e994a

+ 2 - 2
app/Http/Controllers/CorpusController.php

@@ -547,11 +547,11 @@ class CorpusController extends Controller
                     $newSent['content'] = $row->content;
                     $newSent['contentType'] = $row->content_type;
                     $newSent['html'] = "";
-                    $newSent["editor"]=UserApi::getById($row->editor_uid);
+                    $newSent["editor"]=UserApi::getByUuid($row->editor_uid);
                     $newSent['updateAt'] = $row->updated_at;
                     if($mode !== "read"){
                         if(isset($row->acceptor_uid) && !empty($row->acceptor_uid)){
-                            $newSent["acceptor"]=UserApi::getById($row->acceptor_uid);
+                            $newSent["acceptor"]=UserApi::getByUuid($row->acceptor_uid);
                             $newSent["prEditAt"]=$row->pr_edit_at;
                         }
                     }

+ 1 - 1
app/Http/Controllers/ExerciseController.php

@@ -74,7 +74,7 @@ class ExerciseController extends Controller
         foreach ($members as  $member) {
             # code...
             $data = [
-                'user' => UserApi::getById($member->user_id),
+                'user' => UserApi::getByUuid($member->user_id),
                 'wbw' => 0,
                 'translation' => 0,
                 'question' => 0,

+ 1 - 1
app/Http/Resources/CourseMemberResource.php

@@ -20,7 +20,7 @@ class CourseMemberResource extends JsonResource
             "user_id"=> $this->user_id,
             "course_id"=> $this->course_id,
             "role"=> $this->role,
-            "user"=> UserApi::getById($this->user_id),
+            "user"=> UserApi::getByUuid($this->user_id),
             "status"=> $this->status,
             "created_at"=> $this->created_at,
             "updated_at"=> $this->updated_at,

+ 1 - 1
app/Http/Resources/CourseResource.php

@@ -28,7 +28,7 @@ class CourseResource extends JsonResource
             "title"=> $this->title,
             "subtitle"=> $this->subtitle,
             "summary"=> $this->summary,
-            "teacher"=> UserApi::getById($this->teacher),
+            "teacher"=> UserApi::getByUuid($this->teacher),
             "course_count"=>10,
             "member_count"=>CourseMember::where('course_id',$this->id)->count(),
             "publicity"=> $this->publicity,

+ 1 - 1
app/Http/Resources/GroupMemberResource.php

@@ -22,7 +22,7 @@ class GroupMemberResource extends JsonResource
             "power"=> $this->power,
             "level"=> $this->level,
             "status"=> $this->status,
-            "user"=> UserApi::getById($this->user_id),
+            "user"=> UserApi::getByUuid($this->user_id),
             "created_at"=> $this->created_at,
             "updated_at"=> $this->updated_at,
         ];

+ 1 - 1
app/Http/Resources/NissayaEndingResource.php

@@ -24,7 +24,7 @@ class NissayaEndingResource extends JsonResource
             "relation"=> $this->relation,
             "case"=> $this->case,
             "count"=> $this->count,
-            "editor"=> UserApi::getById($this->editor_id),
+            "editor"=> UserApi::getByUuid($this->editor_id),
             "created_at"=> $this->created_at,
             "updated_at"=> $this->updated_at,
         ];

+ 1 - 1
app/Http/Resources/RelationResource.php

@@ -21,7 +21,7 @@ class RelationResource extends JsonResource
             "case"=> $this->case,
             "from"=> json_decode($this->from),
             "to"=> json_decode($this->to),
-            "editor"=> UserApi::getById($this->editor_id),
+            "editor"=> UserApi::getByUuid($this->editor_id),
             "created_at"=> $this->created_at,
             "updated_at"=> $this->updated_at,
         ];

+ 2 - 2
app/Http/Resources/SentResource.php

@@ -34,7 +34,7 @@ class SentResource extends JsonResource
                 "paragraph"=> $this->paragraph,
                 "word_start"=> $this->word_start,
                 "word_end"=> $this->word_end,
-                "editor"=> UserApi::getById($this->editor_uid),
+                "editor"=> UserApi::getByUuid($this->editor_uid),
                 "channel"=> $channel,
                 "studio" => StudioApi::getById($channel["studio_id"]),
                 "updated_at"=> $this->updated_at,
@@ -61,7 +61,7 @@ class SentResource extends JsonResource
                                                                 );
         }
         if(isset($this->acceptor_uid) && !empty($this->acceptor_uid)){
-            $data["acceptor"]=UserApi::getById($this->acceptor_uid);
+            $data["acceptor"]=UserApi::getByUuid($this->acceptor_uid);
             $data["pr_edit_at"]=$this->pr_edit_at;
         }
         return $data;

+ 1 - 1
app/Http/Resources/ShareResource.php

@@ -72,7 +72,7 @@ class ShareResource extends JsonResource
         switch ($this->cooperator_type) {
             case 0:
                 # user
-                $data['user'] = UserApi::getById($this->cooperator_id);
+                $data['user'] = UserApi::getByUuid($this->cooperator_id);
                 break;
             case 1:
                 # code...