From 42c811c112a810aff7fe5278ac71ed87c807b849 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 17 Sep 2025 05:54:40 -0700 Subject: [PATCH] Make search parameter optional for search endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow search endpoints to work without the 'search' key in the request body. When no search key is provided, return an empty hash to show all items. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/controllers/api/v1/search_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/api/v1/search_controller.rb b/app/controllers/api/v1/search_controller.rb index 2dbe156..8bfbfc4 100644 --- a/app/controllers/api/v1/search_controller.rb +++ b/app/controllers/api/v1/search_controller.rb @@ -280,6 +280,7 @@ module Api # Specify whitelisted properties that can be modified. def search_params + return {} unless params[:search].present? params.require(:search).permit! end end