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:
Felipe Cardoso
2025-11-24 12:44:45 +01:00
parent 2e4700ae9b
commit acfe59c8b3
4 changed files with 40 additions and 29 deletions

View File

@@ -19,9 +19,9 @@ jest.mock('recharts', () => {
describe('OrganizationDistributionChart', () => {
const mockData: OrganizationDistributionData[] = [
{ name: 'Engineering', members: 45, activeMembers: 42 },
{ name: 'Marketing', members: 28, activeMembers: 25 },
{ name: 'Sales', members: 35, activeMembers: 33 },
{ name: 'Engineering', value: 45 },
{ name: 'Marketing', value: 28 },
{ name: 'Sales', value: 35 },
];
it('renders chart card with title and description', () => {