From 8dd90fc9c1bf7d2dad670c940e456acf5289157a Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 3 May 2024 01:16:28 +0530 Subject: [PATCH] fix: update the return data-structure --- src/v0/destinations/redis/transform.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/v0/destinations/redis/transform.js b/src/v0/destinations/redis/transform.js index 4c441e737c..231057ce4d 100644 --- a/src/v0/destinations/redis/transform.js +++ b/src/v0/destinations/redis/transform.js @@ -69,10 +69,13 @@ const process = (event) => { } // JSON.SET . return { - key: `${workspaceId}:${destinationId}:${message.context.sources.profiles_entity}:${message.context.sources.profiles_id_type}:${message.userId}`, - value: { - [message.context.sources.profiles_model]: message.traits, + message: { + key: `${workspaceId}:${destinationId}:${message.context.sources.profiles_entity}:${message.context.sources.profiles_id_type}:${message.userId}`, + value: { + [message.context.sources.profiles_model]: message.traits, + }, }, + userId: message.userId, }; } @@ -81,8 +84,11 @@ const process = (event) => { // If redis should store information as JSON type // JSON.SET . return { - key: `${keyPrefix}user:${lodash.toString(message.userId)}`, - value: message.traits || message.context.traits, + message: { + key: `${keyPrefix}user:${lodash.toString(message.userId)}`, + value: message.traits || message.context.traits, + }, + userId: message.userId, }; }