|
|
@@ -218,9 +218,7 @@ module.exports = {
|
|
|
return res.redirect("/login");
|
|
|
})
|
|
|
.catch((err)=>{
|
|
|
- if(typeof(err) === "string"){
|
|
|
- return res.json(err);
|
|
|
- }
|
|
|
+ if(typeof(err) === "string") return res.json(err);
|
|
|
if(err.name === "ValidationError"){
|
|
|
return res.json(err.errors[Object.keys(err.errors)[0]].properties.message);
|
|
|
}
|