visuddhinanda 2 лет назад
Родитель
Сommit
1f3e45c8f4

+ 3 - 0
app/Http/Resources/ArticleResource.php

@@ -171,6 +171,9 @@ class ArticleResource extends JsonResource
                 $mode = 'read';
             }
             $data["html"] = MdRender::render($this->content,$channels,$query_id,$mode);
+            if(empty($this->summary)){
+                $data["_summary"] = MdRender::render($this->content,$channels,$query_id,$mode,'translation','markdown','text');
+            }
         }
         return $data;
     }

+ 1 - 0
app/Http/Resources/DiscussionResource.php

@@ -49,6 +49,7 @@ class DiscussionResource extends JsonResource
         }
         if(count($channels)>0){
             $data["html"] = MdRender::render($this->content,$channels,null,'read');
+            $data["summary"] = MdRender::render($this->content,$channels,null,'read','translation','markdown','text');
         }
 
         return $data;