Skip to content

Commit

Permalink
fixed casing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
RafidMuhymin committed Jan 15, 2024
1 parent db7dfef commit ba189c6
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"] &&
Expand Down Expand Up @@ -187,8 +188,8 @@ export default async function updateCustomer(
...(!alternateContact
? {}
: {
[contactType]: contact,
[alternateContactType]: alternateContact,
[ContactType]: contact,
[AlternateContactType]: alternateContact,
}),
}).then(() => console.log(`Exact: Contact updated`)),
);
Expand All @@ -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"];
Expand Down

0 comments on commit ba189c6

Please sign in to comment.