mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 05:06:37 +00:00
🤖 Auto commit for release 'develop' on 2026-01-23
This commit is contained in:
@@ -51,7 +51,7 @@ class UpdateRequest extends FormRequest
|
||||
'link_type_name' => $this->convertString('link_type_name'),
|
||||
'inward_id' => $this->convertInteger('inward_id'),
|
||||
'outward_id' => $this->convertInteger('outward_id'),
|
||||
'notes' => $this->stringWithNewlines('notes')
|
||||
'notes' => $this->stringWithNewlines('notes'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class UpdateRequest extends FormRequest
|
||||
'link_type_name' => 'exists:link_types,name',
|
||||
'inward_id' => 'belongsToUser:transaction_journals,id|different:outward_id',
|
||||
'outward_id' => 'belongsToUser:transaction_journals,id|different:inward_id',
|
||||
'notes' => 'min:1|max:32768|nullable'
|
||||
'notes' => 'min:1|max:32768|nullable',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -85,21 +85,21 @@ class UpdateRequest extends FormRequest
|
||||
private function validateUpdate(Validator $validator): void
|
||||
{
|
||||
/** @var TransactionJournalLink $existing */
|
||||
$existing = $this->route()->parameter('journalLink');
|
||||
$data = $validator->getData();
|
||||
$existing = $this->route()->parameter('journalLink');
|
||||
$data = $validator->getData();
|
||||
|
||||
/** @var LinkTypeRepositoryInterface $repository */
|
||||
$repository = app(LinkTypeRepositoryInterface::class);
|
||||
$repository = app(LinkTypeRepositoryInterface::class);
|
||||
$repository->setUser(auth()->user());
|
||||
|
||||
/** @var JournalRepositoryInterface $journalRepos */
|
||||
$journalRepos = app(JournalRepositoryInterface::class);
|
||||
$journalRepos->setUser(auth()->user());
|
||||
|
||||
$inwardId = $data['inward_id'] ?? $existing->source_id;
|
||||
$outwardId = $data['outward_id'] ?? $existing->destination_id;
|
||||
$inward = $journalRepos->find((int) $inwardId);
|
||||
$outward = $journalRepos->find((int) $outwardId);
|
||||
$inwardId = $data['inward_id'] ?? $existing->source_id;
|
||||
$outwardId = $data['outward_id'] ?? $existing->destination_id;
|
||||
$inward = $journalRepos->find((int) $inwardId);
|
||||
$outward = $journalRepos->find((int) $outwardId);
|
||||
if (null === $inward) {
|
||||
$inward = $existing->source;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ class UpdateRequest extends FormRequest
|
||||
$validator->errors()->add('outward_id', 'Inward ID must be different from outward ID.');
|
||||
}
|
||||
|
||||
$inDB = $repository->findSpecificLink($existing->linkType, $inward, $outward);
|
||||
$inDB = $repository->findSpecificLink($existing->linkType, $inward, $outward);
|
||||
if (null === $inDB) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user