From d5c7e9e4f5c77989620e07116abb91238d187a57 Mon Sep 17 00:00:00 2001 From: Paul Couture Date: Mon, 18 Dec 2023 09:28:45 -0600 Subject: [PATCH] fix: performance tweak for submitted page --- site/app/Http/Controllers/ArtworkController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/site/app/Http/Controllers/ArtworkController.php b/site/app/Http/Controllers/ArtworkController.php index e664363..d153d2d 100644 --- a/site/app/Http/Controllers/ArtworkController.php +++ b/site/app/Http/Controllers/ArtworkController.php @@ -29,6 +29,8 @@ public function index() $user = auth()->user(); $artworks = Artwork::whereNotNull('approved_by') ->with('artist') + ->with('podcast') + ->with('episode') ->orderBy('episode_id', 'desc') ->orderBy('created_at', 'desc') ->paginate($perPage = 52, $columns = ['*'], $pageName = 'artworks'); @@ -179,8 +181,11 @@ public function destroy(Artwork $artwork) public function approve(Artwork $artwork) { $user = auth()->user(); - $awatingApproval = Artwork::whereNull('approved_by')->with('podcast')->orderBy('created_at', 'asc')->get(); - + $awatingApproval = Artwork::whereNull('approved_by') + ->with('podcast') + ->with('podcast.episode') + ->orderBy('created_at', 'asc') + ->get(); } public function legacyArtLink(Request $request, $any = null)