Review comment, use dig to access voucher_code param

This commit is contained in:
Gaetan Craig-Riou
2023-04-17 11:45:10 +10:00
committed by Maikel Linke
parent 2f1fe6d096
commit a2e1e6ca33

View File

@@ -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)