Skip to content

Commit

Permalink
Add check for parameters-set in index (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavrick authored Sep 6, 2023
1 parent c897bdd commit 66a3b09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/api_wrapper_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class ApiWrapperController < ApplicationController
def index
return unless parameters_set?

result = ApiWrapper::Index::Organizer.call(params_to_validate: index_params)
if result.success?
@activity = result.activity
Expand Down Expand Up @@ -32,4 +34,8 @@ def index_params
def latest_activities_params
params.permit(:order, :sort)
end

def parameters_set?
index_params.values.any?(&:present?)
end
end

0 comments on commit 66a3b09

Please sign in to comment.