Refactor admin stats API and charts data models for consistency
- Updated `AdminStatsResponse` with streamlined type annotations and added `AdminStatsData` type definition. - Renamed chart data model fields (`totalUsers` → `total_users`, `activeUsers` → `active_users`, `members` → `value`, etc.) for alignment with backend naming conventions. - Adjusted related test files to reflect updated data model structure. - Improved readability of `AdminPage` component by reformatting destructuring in `useQuery`.
This commit is contained in:
@@ -19,7 +19,11 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { getAdminStats } from '@/lib/api/admin';
|
||||
|
||||
export default function AdminPage() {
|
||||
const { data: stats, isLoading, error } = useQuery({
|
||||
const {
|
||||
data: stats,
|
||||
isLoading,
|
||||
error,
|
||||
} = useQuery({
|
||||
queryKey: ['admin', 'stats'],
|
||||
queryFn: async () => {
|
||||
const response = await getAdminStats();
|
||||
|
||||
Reference in New Issue
Block a user