Skip to content

Commit

Permalink
Handle mailchimp audience not returning a list id
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Sep 19, 2024
1 parent aa26077 commit e800b26
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Fieldtypes/MailchimpAudience.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ protected function toItemArray($id)
if (! $list = $this->callApi("lists/{$id}")) {
return [];
}


if (! $id = Arr::get($list, 'id')) {
return [];
}

return [
'id' => $list['id'],
'title' => $list['name'],
'id' => $id,
'title' => Arr::get($list, 'name'),
];
}
}

0 comments on commit e800b26

Please sign in to comment.