strapi-community / strapi-plugin-transformer

A plugin for Strapi Headless CMS that provides the ability to transform the API request or response.
https://market.strapi.io/plugins/strapi-plugin-transformer
MIT License
140 stars 22 forks source link

DenyList is not working in my strapi project #72

Closed Montaser-BE closed 1 year ago

Montaser-BE commented 1 year ago

I added strapi-plugin-transfomer to my strapi project and it is working, But I need to exclude some content types apis from being transformed. Currently I added the denylist and all apis are transformed including ones in the denylist. Strapi Version: 4.4.5 Plugin Version: 3.0.0 plugins.ts


export default ({ env }) => ({
  'transformer': {
     enabled: true,
     config: {
       prefix: '',
       responseTransforms: {
         removeAttributesKey: true,
         removeDataKey: true,
       },
       denyList: {
        'api::service.service': true,
      }
     }
   },
   upload: {
    config: {
      breakpoints: {
        xlarge: 1920,
        large: 1000,
        medium: 750,
        small: 500,
        xsmall: 64
      },
    },
  },
 });
ComfortablyCoding commented 1 year ago

The denylist was reworked in #64 due to #62.

It should now be contentTypeFilter as outlined in the docs.


module.exports = ({ env }) => ({ 
  // .. 
 'transformer': { 
  enabled: true, 
  config: { 
    responseTransforms: {
        removeAttributesKey: true, 
        removeDataKey: true, 
    }, 
    contentTypeFilter: { 
     mode: 'deny', 
     uids: { 
       'api::service.service': true
     }
   }
  }
 },
 // .. 
});