mirror of
https://github.com/zyachel/quetre.git
synced 2025-04-04 21:47:38 +03:00
refactor: refactor the controllers a bit to make them more consistent
This commit is contained in:
parent
719988c587
commit
7f0406f054
5 changed files with 45 additions and 17 deletions
|
@ -27,10 +27,14 @@ const sendErrorResponse = (err, req, res, devMode = false) => {
|
|||
// 2. FOR WEBPAGES
|
||||
else
|
||||
res.status(err.statusCode).render('error', {
|
||||
title: 'Error',
|
||||
statusCode: err.statusCode,
|
||||
message: err.message,
|
||||
...(devMode && { stack: err.stack }),
|
||||
data: {
|
||||
statusCode: err.statusCode,
|
||||
message: err.message,
|
||||
...(devMode && { stack: err.stack }),
|
||||
},
|
||||
meta: {
|
||||
title: 'Error',
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue