feat: complete jobcard management workflows and UI
This commit is contained in:
@@ -61,11 +61,12 @@ final class ContactUpdateCommand
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
public function validateForEdit(int $id, array $input, array $existingContacts = []): array
|
||||
public function validateForEdit(mixed $id, array $input, array $existingContacts = []): array
|
||||
{
|
||||
$result = $this->validate($input, $existingContacts, $id);
|
||||
$result['id'] = $id;
|
||||
if ($id < 1) $result['errors']['id'] = 'Contact ID must be a positive integer.';
|
||||
$normalizedId = $this->positiveId($id);
|
||||
$result = $this->validate($input, $existingContacts, $normalizedId);
|
||||
$result['id'] = $normalizedId;
|
||||
if ($normalizedId === null) $result['errors']['id'] = 'Contact ID must be a positive integer.';
|
||||
$result['valid'] = $result['errors'] === [];
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user