Skip to content

Commit

Permalink
new partner_request from current partner instead of using json
Browse files Browse the repository at this point in the history
  • Loading branch information
benreyn committed Oct 21, 2019
1 parent 6502a55 commit 8acd8d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/family_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
if api_response = DiaperBankClient.send_family_request(@family_request.id)
@family_request.update!(sent: true)
flash[:notice] = "Request sent to diaper bank successfully"
partner_request = PartnerRequest.new(api_response.slice("partner_id", "organization_id"))
partner_request = current_partner.partner_requests.new(api_response.slice("organization_id"))
api_response["requested_items"].each do |item_hash|
partner_request.item_requests.new(
name: item_hash["item_name"],
Expand Down

0 comments on commit 8acd8d0

Please sign in to comment.