We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an error handler by using connect-flash.
connect-flash.
Task.findById(id, (err, task) => { if(err){ req.flash('fail', 'Failed Message'); return res.redirect("/notes") } if(!task) { req.flash('fail', 'Failed Message'); return res.redirect("/notes") } task.save((err) => { if(err){ req.flash('fail', 'Failed Message'); return res.redirect("/notes") } req.flash('success', 'Successful Message'); return res.redirect("/notes") }); });
{{#if sessionFlash.message}} <div class="{{ sessionFlash.type }}"> <strong>FLASH!</strong> {{ sessionFlash.message }} </div> {{/if}}
The text was updated successfully, but these errors were encountered:
WeiChienHsu
No branches or pull requests
TODO
Add an error handler by using
connect-flash.
Implementation Notes
The text was updated successfully, but these errors were encountered: