mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Refactor group validation
This commit is contained in:
@@ -160,21 +160,6 @@ trait TransactionValidation
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Validator $validator
|
||||
*/
|
||||
public function validateGroupDescription(Validator $validator): void
|
||||
{
|
||||
Log::debug('Now in validateGroupDescription()');
|
||||
$data = $validator->getData();
|
||||
$transactions = $this->getTransactionsArray($validator);
|
||||
|
||||
$groupTitle = $data['group_title'] ?? '';
|
||||
if ('' === $groupTitle && count($transactions) > 1) {
|
||||
$validator->errors()->add('group_title', (string)trans('validation.group_title_mandatory'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an error to the validator when there are no transactions in the array of data.
|
||||
*
|
||||
|
Reference in New Issue
Block a user