Fix jwt-token

This commit is contained in:
2025-09-13 12:22:11 +02:00
parent f6b8019038
commit fb02eae663
4 changed files with 13 additions and 13 deletions

View File

@@ -17,15 +17,15 @@ const Dashboard = () => {
const loadDashboardData = async () => { const loadDashboardData = async () => {
try { try {
// Load basic stats // Load basic stats from management endpoints
const [tenantsRes, usersRes] = await Promise.all([ const [tenantsRes, systemInfoRes] = await Promise.all([
api.get('/tenants?limit=1'), api.get('/management/tenants?limit=1'),
api.get('/users?limit=1') api.get('/management/system-info')
]) ])
setStats({ setStats({
tenants: tenantsRes.data.pagination?.total || 0, tenants: tenantsRes.data.pagination?.total || 0,
users: usersRes.data.pagination?.total || 0, users: systemInfoRes.data.data?.statistics?.total_users || 0,
activeSessions: Math.floor(Math.random() * 50) + 10, // Mock data activeSessions: Math.floor(Math.random() * 50) + 10, // Mock data
systemHealth: 'good' systemHealth: 'good'
}) })

View File

@@ -20,8 +20,8 @@ const System = () => {
const loadSystemInfo = async () => { const loadSystemInfo = async () => {
try { try {
setLoading(true) setLoading(true)
// This would be a real API endpoint in production // Use the management system-info endpoint
const response = await api.get('/system/info') const response = await api.get('/management/system-info')
setSystemInfo(response.data.data) setSystemInfo(response.data.data)
} catch (error) { } catch (error) {
// Mock data for development // Mock data for development

View File

@@ -39,7 +39,7 @@ const Tenants = () => {
params.append('search', search) params.append('search', search)
} }
const response = await api.get(`/tenants?${params}`) const response = await api.get(`/management/tenants?${params}`)
setTenants(response.data.data) setTenants(response.data.data)
setPagination(response.data.pagination) setPagination(response.data.pagination)
} catch (error) { } catch (error) {
@@ -60,11 +60,11 @@ const Tenants = () => {
try { try {
if (editingTenant) { if (editingTenant) {
// Update existing tenant // Update existing tenant
await api.put(`/tenants/${editingTenant.id}`, tenantData) await api.put(`/management/tenants/${editingTenant.id}`, tenantData)
toast.success('Tenant updated successfully') toast.success('Tenant updated successfully')
} else { } else {
// Create new tenant // Create new tenant
await api.post('/tenants', tenantData) await api.post('/management/tenants', tenantData)
toast.success('Tenant created successfully') toast.success('Tenant created successfully')
} }
@@ -84,7 +84,7 @@ const Tenants = () => {
} }
try { try {
await api.delete(`/tenants/${tenantId}`) await api.delete(`/management/tenants/${tenantId}`)
toast.success('Tenant deleted successfully') toast.success('Tenant deleted successfully')
loadTenants() loadTenants()
} catch (error) { } catch (error) {
@@ -96,7 +96,7 @@ const Tenants = () => {
const handleEditTenant = async (tenant) => { const handleEditTenant = async (tenant) => {
try { try {
// Fetch full tenant details for editing // Fetch full tenant details for editing
const response = await api.get(`/tenants/${tenant.id}`) const response = await api.get(`/management/tenants/${tenant.id}`)
setEditingTenant(response.data.data) setEditingTenant(response.data.data)
setShowCreateModal(true) setShowCreateModal(true)
} catch (error) { } catch (error) {

View File

@@ -15,7 +15,7 @@ const Users = () => {
const loadUsers = async () => { const loadUsers = async () => {
try { try {
setLoading(true) setLoading(true)
const response = await api.get('/users') const response = await api.get('/management/users')
setUsers(response.data.data || []) setUsers(response.data.data || [])
} catch (error) { } catch (error) {
toast.error('Failed to load users') toast.error('Failed to load users')