# frozen_string_literal: true # /customers/phone_verifications module Phone class ConfirmationForm < ApplicationForm attribute :code, String attribute :id, String validates :code, presence: true, length: { minimum: 4, maximum: 16 } def submit return false unless valid? api_answer = TranslationCms::Api::Customers::PhoneVerifications.update(submit_params(attributes)) merge_responce! api_answer errors.empty? end protected def submit_params(params) { id: params.delete(:id), phone_verification: params } end end end