mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
4f5fb3d820
- Update all references to common.errors to use @tryghost/errors - Use dereferencing to only require used bits of common in each file
15 lines
332 B
JavaScript
15 lines
332 B
JavaScript
const errors = require('@tryghost/errors');
|
|
const labsUtil = require('../../../services/labs');
|
|
|
|
const labs = flag => (req, res, next) => {
|
|
if (labsUtil.isSet(flag) === true) {
|
|
return next();
|
|
} else {
|
|
return next(new errors.NotFoundError());
|
|
}
|
|
};
|
|
|
|
labs.members = labs('members');
|
|
|
|
module.exports = labs;
|