mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Handle single contact object passed into array
This commit is contained in:
parent
bfff515b59
commit
b35bdebccf
@ -29,9 +29,15 @@ class ClientContactRepository extends BaseRepository
|
||||
public function save(array $data, Client $client) : void
|
||||
{
|
||||
|
||||
if (isset($data['contacts'])) {
|
||||
if (isset($data['contacts']) && (count($data['contacts']) !== count($data['contacts'], COUNT_RECURSIVE))) {
|
||||
$contacts = collect($data['contacts']);
|
||||
} else {
|
||||
} elseif(isset($data['contacts'])){
|
||||
|
||||
$temp_array[] = $data['contacts'];
|
||||
$contacts = collect($temp_array);
|
||||
|
||||
}
|
||||
else {
|
||||
$contacts = collect();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user