diff --git a/app/services/users/apply_authentication_service.rb b/app/services/users/apply_authentication_service.rb index 9e0901ef4..d6da2d1fb 100644 --- a/app/services/users/apply_authentication_service.rb +++ b/app/services/users/apply_authentication_service.rb @@ -25,10 +25,10 @@ class Users::ApplyAuthenticationService < ApplicationService user.apply_user_authentication.create!(auth_type: 1, status: 0) move_image_file! unless params[:upload_image].to_s == 'false' - - sms_notify_admin end + sms_notify_admin + user end diff --git a/app/services/users/apply_professional_auth_service.rb b/app/services/users/apply_professional_auth_service.rb index cc6f36fff..ea9f3e0d1 100644 --- a/app/services/users/apply_professional_auth_service.rb +++ b/app/services/users/apply_professional_auth_service.rb @@ -37,13 +37,9 @@ class Users::ApplyProfessionalAuthService < ApplicationService user.apply_user_authentication.create!(auth_type: 2, status: 0) move_image_file! unless params[:upload_image].to_s == 'false' - - sms_cache = Rails.cache.read("apply_pro_certification") - if sms_cache.nil? - sms_notify_admin - Rails.cache.write("apply_pro_certification", 1, expires_in: 5.minutes) - end end + + sms_notify_admin end private @@ -61,7 +57,11 @@ class Users::ApplyProfessionalAuthService < ApplicationService end def sms_notify_admin - Educoder::Sms.notify_admin(send_type: 'apply_pro_certification') + sms_cache = Rails.cache.read('apply_pro_certification') + if sms_cache.nil? + Educoder::Sms.notify_admin(send_type: 'apply_pro_certification') + Rails.cache.write('apply_pro_certification', 1, expires_in: 5.minutes) + end rescue => ex Util.logger_error(ex) end