Skip to content

Commit

Permalink
Make sure that the kind matches the type
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp-work authored and danidoni committed Apr 19, 2024
1 parent 990ef08 commit f848427
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/app/controllers/webui/decisions_controller.rb
Expand Up @@ -19,6 +19,8 @@ def create
private

def decision_params
params.require(:decision).permit(:reason, :type, report_ids: [])
# TODO: remove merge and replace decision_kind with decision_type
kind = params[:decision][:type] == 'DecisionFavored' ? 'favor' : 'cleared'
params.require(:decision).permit(:reason, :type, report_ids: []).merge(kind: kind)

Check warning on line 24 in src/api/app/controllers/webui/decisions_controller.rb

View check run for this annotation

Codecov / codecov/patch

src/api/app/controllers/webui/decisions_controller.rb#L23-L24

Added lines #L23 - L24 were not covered by tests
end
end

0 comments on commit f848427

Please sign in to comment.