Skip to content

Commit

Permalink
avoid sending empty data
Browse files Browse the repository at this point in the history
  • Loading branch information
clemzarch committed Aug 24, 2023
1 parent 0ef2401 commit 6288255
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public function __construct(
*/
public function upsertContacts(array $body): void
{
if (empty($body)) {
return;
}

$response = $this->client->sendRequest(
$this->requestFactory->createRequest(
'POST',
Expand All @@ -49,6 +53,10 @@ public function upsertContacts(array $body): void
*/
public function upsertProducts(array $body): void
{
if (empty($body)) {
return;
}

$response = $this->client->sendRequest(
$this->requestFactory->createRequest(
'POST',
Expand All @@ -72,6 +80,10 @@ public function upsertProducts(array $body): void
*/
public function upsertOrders(array $body): void
{
if (empty($body)) {
return;
}

$response = $this->client->sendRequest(
$this->requestFactory->createRequest(
'POST',
Expand Down Expand Up @@ -210,6 +222,10 @@ private function processResponse(ResponseInterface $response): void
*/
public function upsertDeals(array $body): void
{
if (empty($body)) {
return;
}

$response = $this->client->sendRequest(
$this->requestFactory->createRequest(
'POST',
Expand Down

0 comments on commit 6288255

Please sign in to comment.