mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Fix N+1 in #144
This commit is contained in:
parent
2a04281bdc
commit
4c7cf26c16
2 changed files with 2 additions and 2 deletions
|
@ -14,7 +14,7 @@ class StatusController extends Controller
|
|||
{
|
||||
$user = Profile::whereUsername($username)->firstOrFail();
|
||||
$status = Status::whereProfileId($user->id)
|
||||
->withCount('likes')
|
||||
->withCount(['likes', 'comments'])
|
||||
->findOrFail($id);
|
||||
if(!$status->media_path && $status->in_reply_to_id) {
|
||||
return redirect($status->url());
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@extends('layouts.app',['title' => $user->username . " posted a photo: " . $status->likes()->count() . " likes, " . $status->comments()->count() . " comments" ])
|
||||
@extends('layouts.app',['title' => $user->username . " posted a photo: " . $status->likes_count . " likes, " . $status->comments_count . " comments" ])
|
||||
|
||||
@section('content')
|
||||
|
||||
|
|
Loading…
Reference in a new issue