feat: Refactor Filament resources and fix tenant admin login

This commit is contained in:
2025-09-09 21:21:47 +02:00
parent 04ac85107c
commit 9da6803eaa
29 changed files with 627 additions and 459 deletions

View File

@@ -1,7 +1,11 @@
export async function login(email: string, password: string): Promise<{ token: string }> {
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
const res = await fetch('/api/v1/tenant/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': csrfToken || '',
},
body: JSON.stringify({ email, password }),
});
if (!res.ok) throw new Error('Login failed');

View File

@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Tenant Admin</title>
@vite('resources/js/admin/main.tsx')
</head>

View File

@@ -0,0 +1,14 @@
<x-filament-panels::page>
<x-filament-panels::form wire:submit="doImport">
{{ $this->form }}
<x-filament-panels::form.actions
:actions="[
]"
/>
<x-filament::button type="submit" >
Import
</x-filament::button>
</x-filament-panels::form>
</x-filament-panels::page>

View File

@@ -0,0 +1,14 @@
<x-filament-panels::page>
<x-filament-panels::form wire:submit="doImport">
{{ $this->form }}
<x-filament-panels::form.actions
:actions="[
]"
/>
<x-filament::button type="submit" >
Import
</x-filament::button>
</x-filament-panels::form>
</x-filament-panels::page>