Skip to content

Commit

Permalink
save phone number and email from voucher form to client. (overwrites (#…
Browse files Browse the repository at this point in the history
…32)

existing contact data right now, we should have multiple emails and
phones in the future)
  • Loading branch information
mostlyerror authored Feb 19, 2021
1 parent 96f6cb4 commit 8dabfb4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/controllers/vouchers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def create
swap_period: SwapPeriod.current
)

if client_phone_number = params['client']['phone_number']
client.phone_number = client_phone_number
end

if client_email = params['client']['email']
client.email = client_email
end

client.save!

redirect_to @voucher
end

Expand Down

0 comments on commit 8dabfb4

Please sign in to comment.