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

Update PublicApiController, remove expensive and unused relationships

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

+ 0 - 3
app/Http/Controllers/PublicApiController.php

@@ -364,7 +364,6 @@ class PublicApiController extends Controller
                           )
                           )
                           ->whereNull(['in_reply_to_id', 'reblog_of_id'])
                           ->whereNull(['in_reply_to_id', 'reblog_of_id'])
                           ->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
                           ->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
-                          ->with('profile', 'hashtags', 'mentions')
                           ->whereLocal(true)
                           ->whereLocal(true)
                           ->whereScope('public')
                           ->whereScope('public')
                           ->orderBy('id', 'desc')
                           ->orderBy('id', 'desc')
@@ -517,7 +516,6 @@ class PublicApiController extends Controller
                       ->when($textOnlyReplies != true, function($q, $textOnlyReplies) {
                       ->when($textOnlyReplies != true, function($q, $textOnlyReplies) {
                         return $q->whereNull('in_reply_to_id');
                         return $q->whereNull('in_reply_to_id');
                       })
                       })
-                      ->with('profile', 'hashtags', 'mentions')
                       ->where('id', $dir, $id)
                       ->where('id', $dir, $id)
                       ->whereIn('profile_id', $following)
                       ->whereIn('profile_id', $following)
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
@@ -564,7 +562,6 @@ class PublicApiController extends Controller
                       ->when(!$textOnlyReplies, function($q, $textOnlyReplies) {
                       ->when(!$textOnlyReplies, function($q, $textOnlyReplies) {
                         return $q->whereNull('in_reply_to_id');
                         return $q->whereNull('in_reply_to_id');
                       })
                       })
-                      ->with('profile', 'hashtags', 'mentions')
                       ->whereIn('profile_id', $following)
                       ->whereIn('profile_id', $following)
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
                       ->orderBy('created_at', 'desc')
                       ->orderBy('created_at', 'desc')