chore: move enableFeatureMiddleware to utils

This commit is contained in:
Marc-Roig 2023-04-24 16:18:54 +02:00
parent 52b2aed092
commit 66a2bba78e

View File

@ -0,0 +1,15 @@
'use strict';
const { features } = require('@strapi/strapi/lib/utils/ee');
const enableFeatureMiddleware = (featureName) => (ctx, next) => {
if (features.isEnabled(featureName)) {
return next();
}
ctx.status = 404;
};
module.exports = {
enableFeatureMiddleware,
};