|
|
@@ -4,6 +4,7 @@ namespace App\Http\Resources;
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
use App\Http\Api\UserApi;
|
|
|
+use App\Http\Api\ChannelApi;
|
|
|
|
|
|
class SentHistoryResource extends JsonResource
|
|
|
{
|
|
|
@@ -21,8 +22,18 @@ class SentHistoryResource extends JsonResource
|
|
|
"editor" => UserApi::getByUuId($this->user_uid),
|
|
|
'content' => $this->content,
|
|
|
'landmark' => $this->landmark,
|
|
|
+ 'pr_from' => $this->pr_from,
|
|
|
'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;
|
|
|
}
|
|
|
}
|