Skip to content
Snippets Groups Projects
Commit 5d98714f authored by Matt Kirby's avatar Matt Kirby
Browse files

Fixing the userservice update endpoint

parent 78eb9fd4
No related branches found
No related tags found
No related merge requests found
...@@ -177,9 +177,13 @@ export async function updateUser(req,res){ ...@@ -177,9 +177,13 @@ export async function updateUser(req,res){
// update the data // update the data
UserModel.updateOne({ _id : userId }, body, function(err, data){ UserModel.updateOne({ _id : userId }, body, function(err, data){
try{
if(err) throw err; if(err) throw err;
return res.status(201).send({ msg : "Record Updated...!"}); return res.status(201).send({ msg : "Record Updated...!"});
} catch (error) {
return res.status(401).send({ error });
}
}) })
}else{ }else{
...@@ -187,7 +191,7 @@ export async function updateUser(req,res){ ...@@ -187,7 +191,7 @@ export async function updateUser(req,res){
} }
} catch (error) { } catch (error) {
return res.status(401).send({ error }); return res.status(401).send({ error });
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment