Skip to content

Commit

Permalink
Merge pull request #11 from bakaphp/hotfix-empty-address
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioken authored Dec 3, 2021
2 parents faa5b28 + 230c659 commit 631a708
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Leads/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public static function create(Dealer $dealer, User $user, array $data) : self
);
}

if (isset($data['ContactInformation']['Addresses'])
&& empty($data['ContactInformation']['Addresses'])) {
unset($data['ContactInformation']['Addresses']);
}

$response = $client->post('/gateway/v1/contact', json_encode($data));

return new self($response);
Expand Down

0 comments on commit 631a708

Please sign in to comment.