mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
Review comment, use dig to access voucher_code param
This commit is contained in:
committed by
Maikel Linke
parent
2f1fe6d096
commit
a2e1e6ca33
@@ -207,7 +207,7 @@ class SplitCheckoutController < ::BaseController
|
||||
end
|
||||
|
||||
def add_voucher
|
||||
return unless payment_step? && params[:order] && params[:order][:voucher_code].present?
|
||||
return unless payment_step? && params.dig(:order, :voucher_code).present?
|
||||
|
||||
# Fetch Voucher
|
||||
voucher = Voucher.find_by(code: params[:order][:voucher_code], enterprise: @order.distributor)
|
||||
|
||||
Reference in New Issue
Block a user