Add admin dashboard page with usage stats, user breakdown, admin-only nav
This commit is contained in:
@@ -299,4 +299,15 @@ export const fixPlaylist = (playlistId: string) =>
|
||||
export const getTasteProfile = () =>
|
||||
api.get<TasteProfileResponse>('/profile/taste').then((r) => r.data)
|
||||
|
||||
// Admin
|
||||
export interface AdminStats {
|
||||
users: { total: number; pro: number; free: number }
|
||||
playlists: { total: number; total_tracks: number }
|
||||
recommendations: { total: number; today: number; this_week: number; this_month: number; saved: number; disliked: number }
|
||||
user_breakdown: { id: number; name: string; email: string; is_pro: boolean; created_at: string; recommendation_count: number }[]
|
||||
}
|
||||
|
||||
export const getAdminStats = () =>
|
||||
api.get<AdminStats>('/admin/stats').then((r) => r.data)
|
||||
|
||||
export default api
|
||||
|
||||
Reference in New Issue
Block a user