mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 02:36:42 +02:00
refactor: use Validation::getValidated() when using $this->validate() in controllers
This commit is contained in:
parent
ff0e681763
commit
2c07070b2c
18 changed files with 129 additions and 70 deletions
|
|
@ -34,7 +34,9 @@ class BlockController extends Controller
|
|||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$handle = $this->request->getPost('handle');
|
||||
$validData = $this->validator->getValidated();
|
||||
|
||||
$handle = $validData['handle'];
|
||||
|
||||
if ($parts = split_handle($handle)) {
|
||||
try {
|
||||
|
|
@ -69,8 +71,10 @@ class BlockController extends Controller
|
|||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$validData = $this->validator->getValidated();
|
||||
|
||||
model('ActorModel', false)
|
||||
->unblockActor((int) $this->request->getPost('actor_id'));
|
||||
->unblockActor((int) $validData['actor_id']);
|
||||
|
||||
return redirect()->back()
|
||||
->with('message', lang('Fediverse.messages.unblockActorSuccess'));
|
||||
|
|
@ -89,7 +93,9 @@ class BlockController extends Controller
|
|||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$domain = $this->request->getPost('domain');
|
||||
$validData = $this->validator->getValidated();
|
||||
|
||||
$domain = $validData['domain'];
|
||||
model('BlockedDomainModel', false)
|
||||
->blockDomain($domain);
|
||||
|
||||
|
|
@ -112,7 +118,9 @@ class BlockController extends Controller
|
|||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$domain = $this->request->getPost('domain');
|
||||
$validData = $this->validator->getValidated();
|
||||
|
||||
$domain = $validData['domain'];
|
||||
model('BlockedDomainModel', false)
|
||||
->unblockDomain($domain);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue