Bladeren bron

add fork_from pr_from

visuddhinanda 2 jaren geleden
bovenliggende
commit
609f6e2c0e
1 gewijzigde bestanden met toevoegingen van 11 en 0 verwijderingen
  1. 11 0
      app/Http/Resources/SentHistoryResource.php

+ 11 - 0
app/Http/Resources/SentHistoryResource.php

@@ -4,6 +4,7 @@ namespace App\Http\Resources;
 
 
 use Illuminate\Http\Resources\Json\JsonResource;
 use Illuminate\Http\Resources\Json\JsonResource;
 use App\Http\Api\UserApi;
 use App\Http\Api\UserApi;
+use App\Http\Api\ChannelApi;
 
 
 class SentHistoryResource extends JsonResource
 class SentHistoryResource extends JsonResource
 {
 {
@@ -21,8 +22,18 @@ class SentHistoryResource extends JsonResource
             "editor" => UserApi::getByUuId($this->user_uid),
             "editor" => UserApi::getByUuId($this->user_uid),
             'content' => $this->content,
             'content' => $this->content,
             'landmark' => $this->landmark,
             'landmark' => $this->landmark,
+            'pr_from' => $this->pr_from,
             'created_at' => $this->created_at
             'created_at' => $this->created_at
         ];
         ];
+        if($this->fork_from){
+            $fork_from = ChannelApi::getById($this->fork_from);
+            if($fork_from){
+                $data['fork_from'] = $fork_from;
+            }
+        }
+        if($this->accepter_uid){
+            $data['accepter'] = UserApi::getByUuId($this->accepter_uid);
+        }
         return $data;
         return $data;
     }
     }
 }
 }