feat: Refactor Filament resources and fix tenant admin login
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user