Skip to content

Commit

Permalink
Only allow valid heat network options
Browse files Browse the repository at this point in the history
  • Loading branch information
noracato committed Apr 29, 2024
1 parent c57402a commit 24a296e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/api/v3/user_sortables_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ def sortable_subtype
params.permit(:subtype)[:subtype] if params.key?(:subtype)
end

def assert_valid_sortable_subtype
return unless sortable_subtype

if sortable_name == :heat_network_order && %i[lt mt ht].exclude?(sortable_subtype)
render_not_found
end
end

def sortable_params
if params.key?(:order)
params.permit(order: [])
Expand Down

0 comments on commit 24a296e

Please sign in to comment.