From ba189c6097d0baf23fa7a6ad2ef7366fa65b9dfb Mon Sep 17 00:00:00 2001 From: RafidMuhymin Date: Mon, 15 Jan 2024 16:02:11 +0600 Subject: [PATCH] fixed casing issue --- .../src/utils/updateCustomer.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/workers/dilmahtea-me-exact-account/src/utils/updateCustomer.ts b/src/workers/dilmahtea-me-exact-account/src/utils/updateCustomer.ts index 2cf19bb2..12814812 100644 --- a/src/workers/dilmahtea-me-exact-account/src/utils/updateCustomer.ts +++ b/src/workers/dilmahtea-me-exact-account/src/utils/updateCustomer.ts @@ -125,8 +125,9 @@ export default async function updateCustomer( const contact = Email || Phone, contactIsEmail = !!Email; - const contactType = contactIsEmail ? "email" : "phone", - alternateContactType = contactIsEmail ? "phone" : "email"; + const ContactType = contactIsEmail ? "Email" : "Phone", + alternateContactType = contactIsEmail ? "phone" : "email", + AlternateContactType = contactIsEmail ? "Phone" : "Email"; const alternateContact = contactIsEmail ? ExistingCustomer["d:Phone"] && @@ -187,8 +188,8 @@ export default async function updateCustomer( ...(!alternateContact ? {} : { - [contactType]: contact, - [alternateContactType]: alternateContact, + [ContactType]: contact, + [AlternateContactType]: alternateContact, }), }).then(() => console.log(`Exact: Contact updated`)), ); @@ -201,7 +202,7 @@ export default async function updateCustomer( Account: ExistingCustomer["d:ID"], FirstName, LastName, - [contactType]: contact, + [ContactType]: contact, }); return NewContact.entry.content["m:properties"];