Skip to content

Commit

Permalink
4653: Permit :date_range filter param in DistributionsController#index (
Browse files Browse the repository at this point in the history
rubyforgood#4776)

* 4653: Permit :date_range filter param in DistributionsController#index

* Move controller spec to request spec

* Remove unneeded specs
  • Loading branch information
coalest authored and Sukhpreet-s committed Nov 29, 2024
1 parent 3be2f1e commit 41a60e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/distributions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def index
.distributions
.includes(:partner, :storage_location, line_items: [:item])
.order('issued_at DESC')
.apply_filters(filter_params, helpers.selected_range)
.apply_filters(filter_params.except(:date_range), helpers.selected_range)
@paginated_distributions = @distributions.page(params[:page])
@items = current_organization.items.alphabetized
@item_categories = current_organization.item_categories
Expand Down Expand Up @@ -310,7 +310,7 @@ def daily_items(pick_ups)
def filter_params
return {} unless params.key?(:filters)

params.require(:filters).permit(:by_item_id, :by_item_category_id, :by_partner, :by_state, :by_location)
params.require(:filters).permit(:by_item_id, :by_item_category_id, :by_partner, :by_state, :by_location, :date_range)
end

def perform_inventory_check
Expand Down

0 comments on commit 41a60e8

Please sign in to comment.