Skip to content

Commit

Permalink
return responses because without them we are sad
Browse files Browse the repository at this point in the history
- AUT-3515

Co-authored-by: Gergely Illyes <[email protected]>
  • Loading branch information
akapa and Gergely Illyes committed Nov 12, 2024
1 parent 532e99b commit daaed3c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Suite/Api/ContactList.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function findContactListByName(int $customerId, string $listName)
public function addToContactList(int $customerId, int $contactListId, array $contactIds)
{
try {
$this->apiClient->post($this->endPoints->addToContactList($customerId, $contactListId), [
return $this->apiClient->post($this->endPoints->addToContactList($customerId, $contactListId), [
'key_id' => 'id',
'external_ids' => $contactIds
]);
Expand All @@ -81,11 +81,10 @@ public function addToContactList(int $customerId, int $contactListId, array $con
public function replaceContactList(int $customerId, int $contactListId, array $contactIds)
{
try {
$this->apiClient->post($this->endPoints->replaceContactList($customerId, $contactListId), [
return $this->apiClient->post($this->endPoints->replaceContactList($customerId, $contactListId), [
'key_id' => 'id',
'external_ids' => $contactIds
]);
return $contactListId;
} catch (Error $error) {
throw new RequestFailed('Could not add contacts to list: ' . $error->getMessage(), $error->getCode(), $error);
}
Expand All @@ -95,11 +94,10 @@ public function replaceContactList(int $customerId, int $contactListId, array $c
public function deleteContactsFromList(int $customerId, int $contactListId, array $contactIds)
{
try {
$this->apiClient->post($this->endPoints->deleteContactsFromList($customerId, $contactListId), [
return $this->apiClient->post($this->endPoints->deleteContactsFromList($customerId, $contactListId), [
'key_id' => 'id',
'external_ids' => $contactIds
]);
return $contactListId;
} catch (Error $error) {
throw new RequestFailed('Could not delete contacts from list: ' . $error->getMessage(), $error->getCode(), $error);
}
Expand Down

0 comments on commit daaed3c

Please sign in to comment.