diff options
author | Blaster4385 <venkateshchaturvedi12@gmail.com> | 2022-08-26 15:28:27 +0530 |
---|---|---|
committer | Blaster4385 <venkateshchaturvedi12@gmail.com> | 2022-08-26 15:28:27 +0530 |
commit | 7d990a31787716b2f02a7a86d19e6e4be4881053 (patch) | |
tree | 3ee863ede9f7bcdb118b2de65004b13d8169d208 /server | |
parent | af0f6f7aee64d3a018e74c43e051155b06ad2816 (diff) |
Meri Bhais ko anda kyun maara
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/users.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/users.js b/server/controllers/users.js index 12d98a4..e10df1b 100644 --- a/server/controllers/users.js +++ b/server/controllers/users.js @@ -1,4 +1,5 @@ import UserDetails from '../models/users'; +import sendSMS from '../services/twilio'; import generateAadhaar from '../utils/aadhaar'; const createUser = async (req, res) => { @@ -86,8 +87,6 @@ const getUnverifiedUsers = async (req, res) => { const updateUser = async (req, res) => { const {id} = req.params; - - console.log(id, req.body); try { const user = await UserDetails.findByIdAndUpdate( id, @@ -99,6 +98,8 @@ const updateUser = async (req, res) => { await UserDetails.findByIdAndUpdate(id, { $set: {aadhaarNumber: generateAadhaar()}, }); + + sendSMS(user,mobile, `Dear ${user.name}, your Aadhaar Number is ${user.aadhaarNumber} for the EID ${user._id}.`); } res.status(200).json({message: 'User Updated Successfully'}); |