fix: performance tweak for submitted page

This commit is contained in:
Paul Couture 2023-12-18 09:28:45 -06:00
parent 89450f0b79
commit d5c7e9e4f5

View File

@ -29,6 +29,8 @@ public function index()
$user = auth()->user(); $user = auth()->user();
$artworks = Artwork::whereNotNull('approved_by') $artworks = Artwork::whereNotNull('approved_by')
->with('artist') ->with('artist')
->with('podcast')
->with('episode')
->orderBy('episode_id', 'desc') ->orderBy('episode_id', 'desc')
->orderBy('created_at', 'desc') ->orderBy('created_at', 'desc')
->paginate($perPage = 52, $columns = ['*'], $pageName = 'artworks'); ->paginate($perPage = 52, $columns = ['*'], $pageName = 'artworks');
@ -179,8 +181,11 @@ public function destroy(Artwork $artwork)
public function approve(Artwork $artwork) public function approve(Artwork $artwork)
{ {
$user = auth()->user(); $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) public function legacyArtLink(Request $request, $any = null)