18 lines
535 B
TypeScript
18 lines
535 B
TypeScript
import { apiClient } from '../../services/apiClient'
|
|
import type { ActivityItem } from '../../components/desktop/ActivityTimeline'
|
|
|
|
export interface DashboardStats {
|
|
total_users: number
|
|
users_by_role: Record<string, number>
|
|
}
|
|
|
|
export async function fetchStats(): Promise<DashboardStats> {
|
|
const { data } = await apiClient.get('/dashboard/stats')
|
|
return data
|
|
}
|
|
|
|
export async function fetchActivity(): Promise<ActivityItem[]> {
|
|
const { data } = await apiClient.get('/dashboard/activity')
|
|
return data.data as ActivityItem[]
|
|
}
|