mirror of
https://github.com/plankanban/planka.git
synced 2025-12-24 09:15:01 +03:00
feat: Add legal requirements (#1306)
This commit is contained in:
@@ -34,8 +34,15 @@
|
||||
module.exports = function forbidden(message) {
|
||||
const { res } = this;
|
||||
|
||||
return res.status(403).json({
|
||||
const data = {
|
||||
code: 'E_FORBIDDEN',
|
||||
message,
|
||||
});
|
||||
};
|
||||
|
||||
if (_.isPlainObject(message)) {
|
||||
Object.assign(data, message);
|
||||
} else {
|
||||
data.message = message;
|
||||
}
|
||||
|
||||
return res.status(403).json(data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user