Skip to content

Commit

Permalink
fix make payload
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPonchia committed Dec 19, 2024
1 parent 2477350 commit a3d4bed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { makeContactPayload } from './makeContactPayload';
import { acClient } from '../clients/activeCampaignClient';

export async function addOrUpdateContact(user: User) {
const acPayload = makeContactPayload(user);
const contactId = await acClient.getContactByCognitoId(user.username);

const acPayload = makeContactPayload(user);
const { contact } = contactId
? await acClient.updateContact(contactId, acPayload)
: await acClient.createContact(acPayload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { User } from '../types/user';
export function makeContactPayload(user: User): ContactPayload {
return {
contact: {
// email: user.email,
email: '',
email: user.email,
firstName: user.given_name,
lastName: user.family_name,
phone: `cognito:${user.username}`,
Expand Down

0 comments on commit a3d4bed

Please sign in to comment.