Skip to content

Commit

Permalink
stash progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyli97 committed Aug 15, 2024
1 parent ff66d22 commit 774c23c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/kits_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def kit_params
:name,
:visible_to_partners,
:value_in_dollars,
line_items_attributes: [:item_id, :quantity]
item: [line_items_attributes: [:item_id, :quantity]]
)
end

Expand Down
8 changes: 7 additions & 1 deletion app/services/kit_create_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ def self.FindOrCreateKitBaseItem!

def initialize(organization_id:, kit_params:)
@organization_id = organization_id
if kit_params.key?(:item)
# Temporary hack to pretend line_items are directly under kit until the form view is changed when working on #3652
kit_params[:line_items_attributes] = kit_params.delete(:item)[:line_items_attributes]
end
@kit_params = kit_params
# #3707 line items point to item_housing_kit, not the kit
# TODO remove except(:item) once form view is changed
@kit_params_with_organization = kit_params.merge({organization_id: organization.id})
.except(:line_items_attributes) # #3707 line items point to item_housing_kit, not the kit
.except(:line_items_attributes).except(:item)
end

def call
Expand Down

0 comments on commit 774c23c

Please sign in to comment.