Make search parameter optional for search endpoints

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 <noreply@anthropic.com>
This commit is contained in:
Justin Edmund 2025-09-17 05:54:40 -07:00
parent 8225340eec
commit 42c811c112

View file

@ -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