浏览代码

Update PublicApiController

Daniel Supernault 6 年之前
父节点
当前提交
9ca18f6b0d
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      app/Http/Controllers/PublicApiController.php

+ 4 - 6
app/Http/Controllers/PublicApiController.php

@@ -252,8 +252,7 @@ class PublicApiController extends Controller
                         'local',
                         'created_at',
                         'updated_at'
-                      )
-                      ->whereHas('media')
+                      )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
                       ->whereLocal(true)
                       ->whereNull('uri')
                       ->where('id', $dir, $id)
@@ -280,7 +279,7 @@ class PublicApiController extends Controller
                         'local',
                         'created_at',
                         'updated_at'
-                      )->whereHas('media')
+                      )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
                       ->whereLocal(true)
                       ->whereNull('uri')
                       ->whereNotIn('profile_id', $filtered)
@@ -354,8 +353,7 @@ class PublicApiController extends Controller
                         'local',
                         'created_at',
                         'updated_at'
-                      )
-                      ->whereHas('media')
+                      )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
                       ->whereLocal(true)
                       ->whereNull('uri')
                       ->where('id', $dir, $id)
@@ -383,7 +381,7 @@ class PublicApiController extends Controller
                         'local',
                         'created_at',
                         'updated_at'
-                      )->whereHas('media')
+                      )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
                       ->whereLocal(true)
                       ->whereNull('uri')
                       ->whereIn('profile_id', $following)