Remove certain content types from ctm list

This commit is contained in:
Alexandre Bodin 2019-12-06 16:18:35 +01:00
parent d0d0942a14
commit f5a9494cb8

View File

@ -9,9 +9,16 @@ module.exports = {
* Returns the list of available content types * Returns the list of available content types
*/ */
listContentTypes(ctx) { listContentTypes(ctx) {
const contentTypes = Object.keys(strapi.contentTypes).map(uid => { const contentTypes = Object.keys(strapi.contentTypes)
return service.formatContentType(strapi.contentTypes[uid]); .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 = { ctx.body = {
data: contentTypes, data: contentTypes,