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 () => {
try {
// Load basic stats
const [tenantsRes, usersRes] = await Promise.all([
api.get('/tenants?limit=1'),
api.get('/users?limit=1')
// Load basic stats from management endpoints
const [tenantsRes, systemInfoRes] = await Promise.all([
api.get('/management/tenants?limit=1'),
api.get('/management/system-info')
])
setStats({
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
systemHealth: 'good'
})

View File

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

View File

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

View File

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