Skip to content

Commit

Permalink
Make request controllers match for general and specific types
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaiid committed Jan 12, 2025
1 parent 6f1c02b commit 504f278
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/partners/family_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def validate
family_requests_attributes: family_requests_attributes,
request_type: "child"
).initialize_only

if create_service.errors.none?
@partner_request = create_service.partner_request
@total_items = @partner_request.total_items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def validate
family_requests_attributes: individuals_request_params[:items_attributes]&.values,
request_type: "individual"
).initialize_only

if create_service.errors.none?
@partner_request = create_service.partner_request
@total_items = @partner_request.total_items
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/partners/requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ def validate
partner_user_id: current_user.id,
comments: partner_request_params[:comments],
item_requests_attributes: partner_request_params[:item_requests_attributes]&.values || []
)
).initialize_only

create_service.initialize_only
if create_service.errors.none?
@partner_request = create_service.partner_request
@total_items = @partner_request.total_items
Expand Down

0 comments on commit 504f278

Please sign in to comment.