Enforce request validation style rules
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Actions\ProjectPermissions\ProjectPermissionService;
|
||||
use App\Actions\ProjectTicketMetadata\InitializeProjectTicketMetadata;
|
||||
use App\Http\Requests\DeleteProjectRequest;
|
||||
use App\Http\Requests\StoreProjectRequest;
|
||||
use App\Http\Requests\SyncProjectPermissionsRequest;
|
||||
use App\Models\Project;
|
||||
@@ -12,7 +13,6 @@ use App\Models\User;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
@@ -157,17 +157,9 @@ class ProjectController extends Controller
|
||||
->with('status', "{$team->name} permissions were updated.");
|
||||
}
|
||||
|
||||
public function destroy(Request $request, Project $project): RedirectResponse
|
||||
public function destroy(DeleteProjectRequest $request, Project $project): RedirectResponse
|
||||
{
|
||||
$request->validate([
|
||||
'confirmation_key' => [
|
||||
'required',
|
||||
'string',
|
||||
Rule::in([$project->key]),
|
||||
],
|
||||
], [
|
||||
'confirmation_key.in' => 'Enter the exact project key to confirm deletion.',
|
||||
]);
|
||||
$request->validated();
|
||||
|
||||
$projectName = $project->name;
|
||||
|
||||
|
||||
@@ -109,7 +109,16 @@ class ProjectTicketController extends Controller
|
||||
|
||||
$validated = $request->validated();
|
||||
$fieldValues = Arr::get($validated, 'field_values');
|
||||
$ticketAttributes = $request->ticketAttributes();
|
||||
$ticketAttributes = [
|
||||
'acceptance_criteria' => Arr::get($validated, 'acceptance_criteria'),
|
||||
'blocked_comment' => Arr::get($validated, 'blocked_comment'),
|
||||
'description' => Arr::get($validated, 'description'),
|
||||
'is_blocked' => Arr::get($validated, 'is_blocked', false),
|
||||
'parent_ticket_id' => Arr::get($validated, 'parent_ticket_id'),
|
||||
'ticket_priority_id' => Arr::get($validated, 'ticket_priority_id'),
|
||||
'ticket_type_id' => Arr::get($validated, 'ticket_type_id'),
|
||||
'title' => Arr::get($validated, 'title'),
|
||||
];
|
||||
|
||||
$wasUpdated = $this->updateProjectTicket->handle(
|
||||
$ticket,
|
||||
|
||||
Reference in New Issue
Block a user