This commit is contained in:
24c02 2025-12-19 13:23:00 -05:00
parent 665bc1dcd2
commit 3f225e0d77

View file

@ -242,11 +242,14 @@ class Letter::BatchesController < BaseBatchesController
def validate_postage_types
return unless @batch.letter_return_address&.us?
if @batch.us_postage_type.present? && !%w[stamps indicia].include?(@batch.us_postage_type)
us_postage_type = batch_params[:us_postage_type]
intl_postage_type = batch_params[:intl_postage_type]
if us_postage_type.present? && !%w[stamps indicia].include?(us_postage_type)
@batch.errors.add(:us_postage_type, "must be either 'stamps' or 'indicia'")
end
if @batch.intl_postage_type.present? && !%w[stamps indicia].include?(@batch.intl_postage_type)
if intl_postage_type.present? && !%w[stamps indicia].include?(intl_postage_type)
@batch.errors.add(:intl_postage_type, "must be either 'stamps' or 'indicia'")
end
end