From cd56c0f2c252c068d6a720fde85b6574769302e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Ti=E1=BA=BFn=20T=C3=A0i?= <63393170+fdhhhdjd@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:45:22 +0700 Subject: [PATCH] #159 [Cront - Backend] Run Cron API Student --- .../cron_student/controllers/cron_reset_password.controller.js | 2 +- .../cron_student/controllers/cron_verification.controller.js | 2 +- backend-manager-student/src/share/configs/regex.js | 2 ++ .../src/share/services/user_service/verification.service.js | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_reset_password.controller.js b/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_reset_password.controller.js index a3d4066..f3ddf35 100644 --- a/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_reset_password.controller.js +++ b/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_reset_password.controller.js @@ -25,7 +25,7 @@ module.exports = { const isExpired = HELPER.isExpired(resetPassword.reset_password_expire); // If expired delete - if (isExpired !== CONSTANTS.DELETED_DISABLE) { + if (isExpired) { await user_reset_password_model.updateResetPassword( { isdeleted: CONSTANTS.DELETED_ENABLE }, { id: resetPassword.id }, diff --git a/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_verification.controller.js b/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_verification.controller.js index bf487a4..7334cf4 100644 --- a/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_verification.controller.js +++ b/backend-manager-student/src/cron_job/v1/cron_student/controllers/cron_verification.controller.js @@ -26,7 +26,7 @@ module.exports = { const isExpired = HELPER.isExpired(verification.linkEmailExpire); // If expired delete - if (isExpired !== CONSTANTS.DELETED_DISABLE) { + if (isExpired) { await user_verification_model.updateVerification( { isdeleted: CONSTANTS.DELETED_ENABLE }, { verify_id: verification.verify_id }, diff --git a/backend-manager-student/src/share/configs/regex.js b/backend-manager-student/src/share/configs/regex.js index 140b45c..8b87208 100644 --- a/backend-manager-student/src/share/configs/regex.js +++ b/backend-manager-student/src/share/configs/regex.js @@ -18,6 +18,8 @@ module.exports = { * @description REGEX PHONE */ REGEX_PHONE: /^(0[3|5|7|8|9])+([0-9]{8})$/, + REGEX_PHONE_NEW: + '^((+84|84|0)(3([2-9])([0-9]{7})|5([689])([0-9]{7})|7([0-9]{8})|8([1-9])([0-9]{7})|9([0-9])([0-9]{7})))$', /** * @author Nguyễn Tiến Tài * @created_at 22/01/2022 diff --git a/backend-manager-student/src/share/services/user_service/verification.service.js b/backend-manager-student/src/share/services/user_service/verification.service.js index 59851ed..84d8e14 100644 --- a/backend-manager-student/src/share/services/user_service/verification.service.js +++ b/backend-manager-student/src/share/services/user_service/verification.service.js @@ -33,8 +33,7 @@ module.exports = { const data_insert = { verify_id: ran_dom_unique_string, user_id: id, - link_email_expire: Date.now() + CONSTANTS._10_SECONDS, - // link_email_expire: Date.now() + CONSTANTS._10_MINUTES, + link_email_expire: Date.now() + CONSTANTS._10_MINUTES, }; // Insert database