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 | |
parent | af0f6f7aee64d3a018e74c43e051155b06ad2816 (diff) |
Meri Bhais ko anda kyun maara
-rw-r--r-- | admin/src/pages/VerifiedUsers/VerifiedUsers.jsx | 8 | ||||
-rw-r--r-- | server/controllers/users.js | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/admin/src/pages/VerifiedUsers/VerifiedUsers.jsx b/admin/src/pages/VerifiedUsers/VerifiedUsers.jsx index c03791c..3c3e5a9 100644 --- a/admin/src/pages/VerifiedUsers/VerifiedUsers.jsx +++ b/admin/src/pages/VerifiedUsers/VerifiedUsers.jsx @@ -1,13 +1,13 @@ -import React, {useState} from 'react'; +import React, { useState } from 'react'; import Accordion from '../../components/Accordion/Accordion'; import Header from '../../components/Header/Header'; -import {getVerifiedUsers} from '../../services/apiservice'; -import {useQuery} from 'react-query'; +import { getVerifiedUsers } from '../../services/apiservice'; +import { useQuery } from 'react-query'; import styles from './VerifiedUsers.module.css'; const VerifiedUsers = () => { - const {data} = useQuery('verified', getVerifiedUsers); + const { data } = useQuery('verified', getVerifiedUsers); const [inputText, setInputText] = useState(""); 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'}); |