move validator from callback to action interactor and to the api controller

This commit is contained in:
Oleg Hasjanov 2024-01-16 13:00:10 +02:00 committed by Oleg Hasjanov
parent f4d276fc44
commit 8eee65579b
9 changed files with 127 additions and 116 deletions

View file

@ -144,6 +144,10 @@ module Api
def update_and_notify!(contact)
contact.transaction do
contact.save!
contact.validate_email_by_regex_and_mx
contact.remove_force_delete_for_valid_contact
action = current_registrant_user.actions.create!(contact: contact, operation: :update)
contact.registrar.notify(action)
end