Skip to content
Snippets Groups Projects
Select Git revision
  • 988b4f0f6ec176a8c6a1632c7fcae31ccb829f32
  • master default
2 results

template.html

Blame
  • notifications.js 410 B
    const warn = (req, res, title, content) => {
      req.session.user.notifications.push({ title, content, color: "warning" });
      req.session.user.save();
    };
    
    const error = (req, res, title, content) => {
      req.session.user.notifications.push({ title, content, color: "error" });
      req.session.user.save();
      return res.redirect('/'); // TODO redirect to error route or previous
    };
    
    module.exports = { warn, error };