Wire admin studio SSR and search infrastructure

This commit is contained in:
2026-05-01 11:46:06 +02:00
parent 257b0dbef6
commit 18cea8b0f0
329 changed files with 197465 additions and 2741 deletions

View File

@@ -26,6 +26,9 @@ final class AiBiographyAdminController extends Controller
public function index(Request $request): Response
{
$isAdminSurface = $request->routeIs('admin.cp.ai-biography.*');
$routePrefix = $isAdminSurface ? 'admin.cp.ai-biography.' : 'cp.ai-biography.';
$filters = $this->filters($request);
$records = $this->recordsQuery($filters)
@@ -33,7 +36,7 @@ final class AiBiographyAdminController extends Controller
->withQueryString()
->through(fn (CreatorAiBiography $record): array => $this->mapRecord($record));
return Inertia::render('Moderation/AiBiographyAdmin', [
return Inertia::render($isAdminSurface ? 'Admin/AiBiography' : 'Moderation/AiBiographyAdmin', [
'title' => 'AI Biography Review',
'records' => $records,
'filters' => $filters,
@@ -72,14 +75,14 @@ final class AiBiographyAdminController extends Controller
],
],
'endpoints' => [
'index' => route('cp.ai-biography.index'),
'rebuildPattern' => route('cp.ai-biography.rebuild', ['user' => '__USER__']),
'approvePattern' => route('cp.ai-biography.approve', ['biography' => '__BIOGRAPHY__']),
'flagPattern' => route('cp.ai-biography.flag', ['biography' => '__BIOGRAPHY__']),
'hidePattern' => route('cp.ai-biography.hide', ['biography' => '__BIOGRAPHY__']),
'showPattern' => route('cp.ai-biography.show', ['biography' => '__BIOGRAPHY__']),
'index' => route($routePrefix . 'index'),
'rebuildPattern' => route($routePrefix . 'rebuild', ['user' => '__USER__']),
'approvePattern' => route($routePrefix . 'approve', ['biography' => '__BIOGRAPHY__']),
'flagPattern' => route($routePrefix . 'flag', ['biography' => '__BIOGRAPHY__']),
'hidePattern' => route($routePrefix . 'hide', ['biography' => '__BIOGRAPHY__']),
'showPattern' => route($routePrefix . 'show', ['biography' => '__BIOGRAPHY__']),
],
])->rootView('moderation');
])->rootView($isAdminSurface ? 'admin' : 'moderation');
}
public function rebuild(User $user): JsonResponse