Skip to content

Commit

Permalink
Merge pull request #46 from ComfortablyCoding/fix-remove-transformer-…
Browse files Browse the repository at this point in the history
…plugin

fix(recv): remove transformer plugin
  • Loading branch information
stafyniaksacha authored Mar 15, 2023
2 parents 29f0afe + 48abc16 commit fc7df3f
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/strapi-plugin-rest-cache/server/middlewares/recv.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,9 @@ function createRecv(options, { strapi }) {
);
});
}
let data = ctx.body;
const transformer = strapi.service(
'plugin::transformer.transformService'
);

// Transformer plugin is installed, transform data before storing in cache
if (transformer) {
const transformerConfig = strapi.config.get('plugin.transformer');
data = transformer.response(transformerConfig, ctx.body);
}

// persist cache asynchronously
store.set(cacheKey, data, maxAge).catch(() => {
store.set(cacheKey, ctx.body, maxAge).catch(() => {
debug(
`[RECV] GET ${cacheKey} ${chalk.yellow(
'Unable to store Content in cache'
Expand Down

0 comments on commit fc7df3f

Please sign in to comment.