mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
#591 - tests
This commit is contained in:
@ -34,7 +34,7 @@ class RedirectController extends Controller
|
||||
#[ResponseFromApiResource(RedirectResource::class, Redirect::class, collection: true, paginate: 25)]
|
||||
public function index(Project $project, Server $server, Site $site): ResourceCollection
|
||||
{
|
||||
$this->authorize('view', [Redirect::class, $site, $server]);
|
||||
$this->authorize('viewAny', [Redirect::class, $site, $server]);
|
||||
|
||||
$this->validateRoute($project, $server, $site);
|
||||
|
||||
@ -53,8 +53,6 @@ public function create(Request $request, Project $project, Server $server, Site
|
||||
|
||||
$this->validateRoute($project, $server, $site);
|
||||
|
||||
$this->validate($request, CreateRedirect::rules($site));
|
||||
|
||||
$redirect = app(CreateRedirect::class)->create($site, $request->all());
|
||||
|
||||
return new RedirectResource($redirect);
|
||||
@ -65,7 +63,7 @@ public function create(Request $request, Project $project, Server $server, Site
|
||||
#[Response(status: 204)]
|
||||
public function delete(Project $project, Server $server, Site $site, Redirect $redirect): HttpResponse
|
||||
{
|
||||
$this->authorize('delete', [Redirect::class, $site, $server]);
|
||||
$this->authorize('delete', [$redirect, $site, $server]);
|
||||
|
||||
$this->validateRoute($project, $server, $site);
|
||||
|
||||
|
Reference in New Issue
Block a user