Add more tests
This commit is contained in:
25
frontend/src/api/endpoints/dashboard.ts
Normal file
25
frontend/src/api/endpoints/dashboard.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import apiClient from '../client'
|
||||
import type {
|
||||
DashboardStatsResponse,
|
||||
DashboardActiveModelResponse,
|
||||
RecentActivityResponse,
|
||||
} from '../types'
|
||||
|
||||
export const dashboardApi = {
|
||||
getStats: async (): Promise<DashboardStatsResponse> => {
|
||||
const response = await apiClient.get('/api/v1/admin/dashboard/stats')
|
||||
return response.data
|
||||
},
|
||||
|
||||
getActiveModel: async (): Promise<DashboardActiveModelResponse> => {
|
||||
const response = await apiClient.get('/api/v1/admin/dashboard/active-model')
|
||||
return response.data
|
||||
},
|
||||
|
||||
getRecentActivity: async (limit: number = 10): Promise<RecentActivityResponse> => {
|
||||
const response = await apiClient.get('/api/v1/admin/dashboard/activity', {
|
||||
params: { limit },
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user