locals.handler.js 367 B

123456789101112131415161718192021
  1. function createLink(req, res, next) {
  2. res.locals.show_advanced = !!req.body.show_advanced;
  3. next();
  4. }
  5. function editLink(req, res, next) {
  6. res.locals.id = req.params.id;
  7. res.locals.class = "no-animation";
  8. next();
  9. }
  10. function protected(req, res, next) {
  11. res.locals.id = req.params.id;
  12. next();
  13. }
  14. module.exports = {
  15. createLink,
  16. editLink,
  17. protected,
  18. }