no message

This commit is contained in:
2018-03-08 00:50:17 -05:00
parent b0785edf90
commit 448b4f4355

View File

@@ -327,13 +327,13 @@ Router.route('/:id?')
})
.patch( update )
.post((req, res) => {
Token.verifyThen(req.get('authorization'), 'add', (err, decoded) => {
if (err || (decoded && !decoded.hasPermission)) {
res.status(403).json({ message: 'User not authorized to perform this action.', err: err });
return;
}
if (decoded && decoded.hasPermission) {
// Token.verifyThen(req.get('authorization'), 'add', (err, decoded) => {
// if (err || (decoded && !decoded.hasPermission)) {
// res.status(403).json({ message: 'User not authorized to perform this action.', err: err });
// return;
// }
//
// if (decoded && decoded.hasPermission) {
var ProfileEvents = new EventEmitter();
var profile = Array.isArray(req.body) ? req.body : [ req.body ];
var multi = profile.length > 1;
@@ -349,8 +349,8 @@ Router.route('/:id?')
});
Profiles.create(ProfileEvents, profile);
}
});
// }
// });
})
.put( update );