Limit-Status im Upload-Flow anzeigen (Warnbanner + Sperrzustände).

Upload-Fehlercodes auswerten und freundliche Dialoge zeigen.
This commit is contained in:
Codex Agent
2025-11-01 19:50:17 +01:00
parent 2c14493604
commit 79b209de9a
55 changed files with 3348 additions and 462 deletions

View File

@@ -3,8 +3,10 @@
namespace App\Http\Controllers\Api;
use App\Models\LegalPage;
use App\Support\ApiError;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Symfony\Component\HttpFoundation\Response;
class LegalController extends BaseController
{
@@ -27,7 +29,13 @@ class LegalController extends BaseController
->orderByDesc('version')
->first();
if (! $page) {
return response()->json(['error' => ['code' => 'not_found', 'message' => 'Legal page not found']], 404);
return ApiError::response(
'legal_page_not_found',
'Legal Page Not Found',
'The requested legal document does not exist.',
Response::HTTP_NOT_FOUND,
['slug' => $resolved]
);
}
$title = $page->title[$locale] ?? $page->title[$page->locale_fallback] ?? $page->title['de'] ?? $page->title['en'] ?? $page->slug;