visuddhinanda 3 лет назад
Родитель
Сommit
cc04a9f49d
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      app/Http/Resources/SentPrResource.php

+ 3 - 2
app/Http/Resources/SentPrResource.php

@@ -24,6 +24,7 @@ class SentPrResource extends JsonResource
         if($user && $user["user_uid"] === $this->editor_uid ){
             $role = 'owner';
         }
+        $channel = ChannelApi::getById($this->channel_uid);
         return [
             "id"=>$this->id,
             "book"=> $this->book_id,
@@ -31,9 +32,9 @@ class SentPrResource extends JsonResource
             "word_start"=> $this->word_start,
             "word_end"=> $this->word_end,
             "editor"=> StudioApi::getById($this->editor_uid),
-            "channel"=> ChannelApi::getById($this->channel_uid),
+            "channel"=> $channel,
             "content"=>$this->content,
-            "html"=> MdRender::render($this->content,$this->channel_uid),
+            "html"=> MdRender::render($this->content,$this->channel_uid,null,$mode,$channel['type']),
             "role"=>$role,
             "created_at"=> $this->created_at,
             "updated_at"=> $this->updated_at,