Skip to content

Commit

Permalink
added fcm token on user signin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald-pro committed Aug 7, 2024
1 parent ebbd40d commit f6e9439
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion models/n_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions routes/processes/nishauri_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 } }
);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 } }
);
Expand Down

0 comments on commit f6e9439

Please sign in to comment.