Prevent creating client without contacts

This commit is contained in:
Hillel Coren 2017-05-26 11:04:40 +03:00
parent ec1dca1970
commit 954dbb690b

View File

@ -116,7 +116,7 @@ class ClientRepository extends BaseRepository
*/ */
$first = true; $first = true;
$contacts = isset($data['contact']) ? [$data['contact']] : isset($data['contacts']) ? $data['contacts'] : [[]]; $contacts = isset($data['contact']) ? [$data['contact']] : (isset($data['contacts']) ? $data['contacts'] : [[]]);
$contactIds = []; $contactIds = [];
// If the primary is set ensure it's listed first // If the primary is set ensure it's listed first