From 04c8b47a8af73510b3d221c0e341c08622e685cb Mon Sep 17 00:00:00 2001 From: Kovah Date: Mon, 5 Feb 2024 22:57:03 +0100 Subject: [PATCH] Fix order direction handling for controllers --- app/Http/Controllers/Guest/TagController.php | 2 +- app/Http/Controllers/Models/ListController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Guest/TagController.php b/app/Http/Controllers/Guest/TagController.php index 33eb8f98..8baf9f4a 100644 --- a/app/Http/Controllers/Guest/TagController.php +++ b/app/Http/Controllers/Guest/TagController.php @@ -52,7 +52,7 @@ class TagController extends Controller ->publicOnly() ->orderBy( $request->input('orderBy', 'title'), - $request->input('orderDir', 'asc') + $this->getOrderDirection($request, 'asc') )->paginate(getPaginationLimit()); return view('guest.tags.show', [ diff --git a/app/Http/Controllers/Models/ListController.php b/app/Http/Controllers/Models/ListController.php index d15299da..dae33e8d 100644 --- a/app/Http/Controllers/Models/ListController.php +++ b/app/Http/Controllers/Models/ListController.php @@ -97,7 +97,7 @@ class ListController extends Controller ->byUser() ->orderBy( $request->input('orderBy', 'created_at'), - $request->input('orderDir', 'desc') + $this->getOrderDirection($request) )->paginate(getPaginationLimit()); return view('models.lists.show', [