coolify/app/Http/Controllers
Andras Bacsai fa8393184f refactor: improve validation error handling and coding standards
Changes:
1. Add explicit try-catch blocks around validateDockerComposeForInjection()
   in API endpoints to return proper 422 JSON responses with validation errors
2. Rename $service_payload to $servicePayload for PSR-12 compliance (camelCase)

API endpoints now properly handle validation failures:
- One-click service creation (line 334)
- Custom compose service creation (line 480)
- Service update endpoint (line 808)

All return consistent error format:
{
  "message": "Validation failed.",
  "errors": {
    "docker_compose_raw": "Invalid Docker Compose service name: ..."
  }
}

Livewire components already have proper exception handling via handleError().

All 60 security tests pass (176 assertions).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 09:51:37 +02:00
..
Api refactor: improve validation error handling and coding standards 2025-10-16 09:51:37 +02:00
Webhook refactor(webhook): remove Webhook model and related logic; add migrations to drop webhooks and kubernetes tables 2025-09-10 19:35:53 +02:00
Controller.php refactor(invitation): rename methods for consistency and enhance invitation deletion logic 2025-06-25 11:45:55 +02:00
MagicController.php Revert "rector: arrrrr" 2025-01-07 15:31:43 +01:00
OauthController.php Revert "rector: arrrrr" 2025-01-07 15:31:43 +01:00
UploadController.php Revert "rector: arrrrr" 2025-01-07 15:31:43 +01:00