Skip to content

Commit

Permalink
fix empty params
Browse files Browse the repository at this point in the history
  • Loading branch information
VKoptev committed Feb 15, 2024
1 parent b74c007 commit 8ad288c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Postback.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,21 @@ protected function mapProperty(string $key): array

switch ($key) {
case "status":
$query[$param] = $this->status->value();
if (is_null($this->status)) {
$query[$param] = $this->status->value();
}
break;
case "customFields":
foreach ($this->customFields as $i => $value) {
$query[$param . $i] = $value;
if (!is_null($value)) {
$query[$param . $i] = $value;
}
}
break;
default:
$query[$param] = $this->$key;
if (!is_null($this->$key)) {
$query[$param] = $this->$key;
}
break;
}

Expand Down

0 comments on commit 8ad288c

Please sign in to comment.