From 073f7b324628171cba929abc57fa47919e3c7288 Mon Sep 17 00:00:00 2001 From: Jamal Soueidan Date: Fri, 31 May 2024 02:51:45 +0200 Subject: [PATCH] Wrap specialties and professions in objects before JSON.stringify in metaobject functions --- .../customer/create/create-user-metaobject.spec.ts | 4 ++-- .../orchestrations/customer/create/create-user-metaobject.ts | 4 ++-- .../customer/update/update-user-metaobject.spec.ts | 4 ++-- .../orchestrations/customer/update/update-user-metaobject.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/functions/customer/orchestrations/customer/create/create-user-metaobject.spec.ts b/src/functions/customer/orchestrations/customer/create/create-user-metaobject.spec.ts index 02dceec0..26c60d4f 100644 --- a/src/functions/customer/orchestrations/customer/create/create-user-metaobject.spec.ts +++ b/src/functions/customer/orchestrations/customer/create/create-user-metaobject.spec.ts @@ -105,11 +105,11 @@ describe("CustomerCreateOrchestration", () => { }, { key: "specialties", - value: JSON.stringify(userData.specialties), + value: JSON.stringify({ specialties: userData.specialties || [] }), }, { key: "professions", - value: JSON.stringify(userData.professions || []), + value: JSON.stringify({ professions: userData.professions || [] }), }, { key: "collection", diff --git a/src/functions/customer/orchestrations/customer/create/create-user-metaobject.ts b/src/functions/customer/orchestrations/customer/create/create-user-metaobject.ts index 69fb35e8..49e5aea5 100644 --- a/src/functions/customer/orchestrations/customer/create/create-user-metaobject.ts +++ b/src/functions/customer/orchestrations/customer/create/create-user-metaobject.ts @@ -31,11 +31,11 @@ export const createUserMetaobject = async ({ }, { key: "specialties", - value: JSON.stringify(user.specialties || []), + value: JSON.stringify({ specialties: user.specialties || [] }), }, { key: "professions", - value: JSON.stringify(user.professions || []), + value: JSON.stringify({ professions: user.professions || [] }), }, { key: "collection", diff --git a/src/functions/customer/orchestrations/customer/update/update-user-metaobject.spec.ts b/src/functions/customer/orchestrations/customer/update/update-user-metaobject.spec.ts index 3a98c990..f39b970e 100644 --- a/src/functions/customer/orchestrations/customer/update/update-user-metaobject.spec.ts +++ b/src/functions/customer/orchestrations/customer/update/update-user-metaobject.spec.ts @@ -106,11 +106,11 @@ describe("CustomerUpdateOrchestration", () => { }, { key: "specialties", - value: JSON.stringify(user.specialties || []), + value: JSON.stringify({ specialties: user.specialties || [] }), }, { key: "professions", - value: JSON.stringify(user.professions || []), + value: JSON.stringify({ professions: user.professions || [] }), }, { key: "social", diff --git a/src/functions/customer/orchestrations/customer/update/update-user-metaobject.ts b/src/functions/customer/orchestrations/customer/update/update-user-metaobject.ts index c19c93d0..41e90386 100644 --- a/src/functions/customer/orchestrations/customer/update/update-user-metaobject.ts +++ b/src/functions/customer/orchestrations/customer/update/update-user-metaobject.ts @@ -37,11 +37,11 @@ export const updateUserMetaobject = async ({ }, { key: "specialties", - value: JSON.stringify(user.specialties || []), + value: JSON.stringify({ specialties: user.specialties || [] }), }, { key: "professions", - value: JSON.stringify(user.professions || []), + value: JSON.stringify({ professions: user.professions || [] }), }, { key: "social",