From f5a9494cb85cf67afca122daaebad5d78f682000 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Fri, 6 Dec 2019 16:18:35 +0100 Subject: [PATCH] Remove certain content types from ctm list --- .../controllers/ContentTypes.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/strapi-plugin-content-manager/controllers/ContentTypes.js b/packages/strapi-plugin-content-manager/controllers/ContentTypes.js index cc11bb255f..58ef1152e5 100644 --- a/packages/strapi-plugin-content-manager/controllers/ContentTypes.js +++ b/packages/strapi-plugin-content-manager/controllers/ContentTypes.js @@ -9,9 +9,16 @@ module.exports = { * Returns the list of available content types */ listContentTypes(ctx) { - const contentTypes = Object.keys(strapi.contentTypes).map(uid => { - return service.formatContentType(strapi.contentTypes[uid]); - }); + const contentTypes = Object.keys(strapi.contentTypes) + .filter(uid => { + if (uid.startsWith('strapi::')) return false; + if (uid === 'plugins::upload.file') return false; + + return true; + }) + .map(uid => { + return service.formatContentType(strapi.contentTypes[uid]); + }); ctx.body = { data: contentTypes,