From f6e9439a5a21fde2cfc14f6b5b1e3d4d89c1ed9d Mon Sep 17 00:00:00 2001 From: Ronald-pro <36841157+Ronald-pro@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:36:52 +0300 Subject: [PATCH] added fcm token on user signin --- models/n_users.js | 3 ++- routes/processes/nishauri_new.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/models/n_users.js b/models/n_users.js index f8e98d3..fd5ccac 100644 --- a/models/n_users.js +++ b/models/n_users.js @@ -29,7 +29,8 @@ const NUsers = sequelize.sequelize.define( refresh_token: Sequelize.STRING, app_version: Sequelize.STRING, chatbot_consent: Sequelize.STRING, - chatbot_consent_date: Sequelize.DATE + chatbot_consent_date: Sequelize.DATE, + fcm_token: Sequelize.STRING }, { timestamps: true, diff --git a/routes/processes/nishauri_new.js b/routes/processes/nishauri_new.js index b847cd9..2c37ae5 100644 --- a/routes/processes/nishauri_new.js +++ b/routes/processes/nishauri_new.js @@ -78,6 +78,7 @@ router.post("/signup", async (req, res) => { let gender = req.body.gender; let today = moment(new Date().toDateString()).format("YYYY-MM-DD"); let app_version = req.body.app_version; + let fcm_token = req.body.fcm_token; // Check if Terms Are Accepted let boolVal; @@ -142,7 +143,8 @@ router.post("/signup", async (req, res) => { { refresh_token: refreshToken, last_login: today, - app_version: app_version + app_version: app_version, + fcm_token: fcm_token }, { where: { id: new_user.id } } ); @@ -285,6 +287,7 @@ router.post("/signin", async (req, res) => { let vusername = req.body.user_name; let password_1 = req.body.password; let app_version = req.body.app_version; + let fcm_token = req.body.fcm_token; let today = moment(new Date().toDateString()).format("YYYY-MM-DD"); //Check If User Exists @@ -375,7 +378,8 @@ router.post("/signin", async (req, res) => { { last_login: today, refresh_token: refreshToken, - app_version: app_version + app_version: app_version, + fcm_token: fcm_token }, { where: { id: check_username.id } } );