If not contacts array is passed, do no attempt to modify / save contacts

This commit is contained in:
David Bomba 2023-01-24 07:38:57 +11:00
parent 3a95441c1c
commit df6e9bc9b8

View File

@ -102,7 +102,8 @@ class ClientRepository extends BaseRepository
$data['name'] = $client->present()->name();
}
$this->contact_repo->save($contact_data, $client);
if(array_key_exists('contacts', $contact_data))
$this->contact_repo->save($contact_data, $client);
return $client;
}