Преглед на файлове

Update PublicApiController

Daniel Supernault преди 6 години
родител
ревизия
41050f3a69
променени са 1 файла, в които са добавени 32 реда и са изтрити 2 реда
  1. 32 2
      app/Http/Controllers/PublicApiController.php

+ 32 - 2
app/Http/Controllers/PublicApiController.php

@@ -236,7 +236,22 @@ class PublicApiController extends Controller
         if($min || $max) {
             $dir = $min ? '>' : '<';
             $id = $min ?? $max;
-            $timeline = Status::whereHas('media')
+            $timeline = Status::select(
+                        'id', 
+                        'uri',
+                        'caption',
+                        'rendered',
+                        'profile_id', 
+                        'type',
+                        'in_reply_to_id',
+                        'reblog_of_id',
+                        'is_nsfw',
+                        'scope',
+                        'local',
+                        'created_at',
+                        'updated_at'
+                      )
+                      ->whereHas('media')
                       ->whereLocal(true)
                       ->whereNull('uri')
                       ->where('id', $dir, $id)
@@ -302,7 +317,22 @@ class PublicApiController extends Controller
         if($min || $max) {
             $dir = $min ? '>' : '<';
             $id = $min ?? $max;
-            $timeline = Status::whereHas('media')
+            $timeline = Status::select(
+                        'id', 
+                        'uri',
+                        'caption',
+                        'rendered',
+                        'profile_id', 
+                        'type',
+                        'in_reply_to_id',
+                        'reblog_of_id',
+                        'is_nsfw',
+                        'scope',
+                        'local',
+                        'created_at',
+                        'updated_at'
+                      )
+                      ->whereHas('media')
                       ->whereLocal(true)
                       ->whereNull('uri')
                       ->where('id', $dir, $id)