Skip to content
Snippets Groups Projects
Verified Commit 90be5628 authored by Damien's avatar Damien
Browse files

FEAT #9700 Lastname mandatory for no corporate person

parent 37e795d4
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,9 @@ class ContactController
}
if ($data['isCorporatePerson'] != 'Y') {
$data['isCorporatePerson'] = 'N';
if (!Validator::stringType()->notEmpty()->validate($data['lastname'])) {
return $response->withStatus(400)->withJson(['errors' => 'Body lastname is empty or not a string']);
}
} else {
$data['addressFirstname'] = $data['firstname'];
$data['addressLastname'] = $data['lastname'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment