From 5c2b0bf0aa38fdb5b58fc73becc60dde1faef194 Mon Sep 17 00:00:00 2001 From: annarhughes Date: Mon, 6 Jan 2025 13:14:49 +0000 Subject: [PATCH] fix crisp people data error --- src/api/mailchimp/mailchimp-api.ts | 2 +- src/crisp/crisp.service.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/api/mailchimp/mailchimp-api.ts b/src/api/mailchimp/mailchimp-api.ts index 06937b29..9c3561fe 100644 --- a/src/api/mailchimp/mailchimp-api.ts +++ b/src/api/mailchimp/mailchimp-api.ts @@ -32,7 +32,7 @@ export const createMailchimpProfile = async ( try { return await mailchimp.lists.addListMember(mailchimpAudienceId, profileData); } catch (error) { - throw new Error(`Create mailchimp profile API call failed: ${error}`); + throw new Error(`Create mailchimp profile API call failed: ${JSON.stringify(error)}`); } }; diff --git a/src/crisp/crisp.service.ts b/src/crisp/crisp.service.ts index fa4ba7dc..4079384c 100644 --- a/src/crisp/crisp.service.ts +++ b/src/crisp/crisp.service.ts @@ -101,11 +101,9 @@ export class CrispService { email: string, ): Promise { try { - const crispPeopleData = CrispClient.website.updatePeopleData( - crispWebsiteId, - email, - peopleData, - ); + const crispPeopleData = CrispClient.website.updatePeopleData(crispWebsiteId, email, { + data: peopleData, + }); return crispPeopleData; } catch (error) { throw new Error(`Update crisp profile API call failed: ${error}`);