From 48abc1669c186110eb93d547dffb5421bb8b6477 Mon Sep 17 00:00:00 2001 From: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> Date: Wed, 15 Feb 2023 22:42:59 -0500 Subject: [PATCH] fix(recv): remove transformer plugin As of v3 of the transformer plugin this is no longer required and will break rest--cache if left in --- .../server/middlewares/recv.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/strapi-plugin-rest-cache/server/middlewares/recv.js b/packages/strapi-plugin-rest-cache/server/middlewares/recv.js index 2f6048a1b..dbf34dc93 100644 --- a/packages/strapi-plugin-rest-cache/server/middlewares/recv.js +++ b/packages/strapi-plugin-rest-cache/server/middlewares/recv.js @@ -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'