Skip to content
Snippets Groups Projects

Create endpoint for user-registration

3 files
+ 23
4
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -170,13 +170,13 @@ body: {
export async function updateUser(req,res){
try {
const id = req.query.id;
const {userId} = req.user;
if(id){
if(userId){
const body = req.body;
// update the data
UserModel.updateOne({ _id : id }, body, function(err, data){
UserModel.updateOne({ _id : userId }, body, function(err, data){
if(err) throw err;
return res.status(201).send({ msg : "Record Updated...!"});
Loading