enhance check for requirement of company field

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-20 14:21:40 +01:00
parent 033393880d
commit eabc78c84f

View File

@@ -96,7 +96,7 @@ class Customers extends ApiCommand implements ResourceEntity
// parameters
$name = $this->getParam('name', true, '');
$firstname = $this->getParam('firstname', true, '');
$company_required = (empty($name) && empty($firstname));
$company_required = (! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname));
$company = $this->getParam('company', $company_required, '');
$street = $this->getParam('street', true, '');
$zipcode = $this->getParam('zipcode', true, '');