fix(server/flash): Api to match documentation

This fixes duplication issues and normalize our use with everyone else
This commit is contained in:
Berkeley Martinez
2018-01-12 14:16:33 -08:00
parent 0cd21f930f
commit 4a911931d0
10 changed files with 88 additions and 86 deletions

View File

@@ -134,15 +134,17 @@ module.exports = function(app) {
return User.updateAll(query, params, function(err, info) {
if (err) { return next(err); }
if (info.count === 0) {
req.flash('info', {
msg: 'Email address not found. ' +
'Please update your Email preferences from your profile.'
});
req.flash(
'info',
'Email address not found. ' +
'Please update your Email preferences from your profile.'
);
return res.redirect('/map');
} else {
req.flash('info', {
msg: 'We\'ve successfully updated your Email preferences.'
});
req.flash(
'info',
'We\'ve successfully updated your Email preferences.'
);
return res.redirect('/unsubscribed');
}
});