Refactor organization and user management components/tests for simplification and improved clarity

- Removed unused properties (`slug`, `is_active`, etc.) in organization and user-related components and test data.
- Simplified function data typing by removing redundant `any` usage.
- Updated `params` in `OrganizationMembersPage` for Promise resolution and async handling.
- Cleaned up unused variables and streamlined form handling in `AddMemberDialog`.
This commit is contained in:
Felipe Cardoso
2025-11-07 00:14:10 +01:00
parent f8b77200f0
commit 6b556431d3
11 changed files with 12 additions and 23 deletions

View File

@@ -487,7 +487,6 @@ describe('useAdmin hooks', () => {
first_name: 'New',
last_name: 'User',
password: 'Password123',
is_active: true,
is_superuser: false,
});
});
@@ -498,7 +497,6 @@ describe('useAdmin hooks', () => {
first_name: 'New',
last_name: 'User',
password: 'Password123',
is_active: true,
is_superuser: false,
},
throwOnError: false,
@@ -516,7 +514,6 @@ describe('useAdmin hooks', () => {
email: 'test@example.com',
first_name: 'Test',
password: 'Password123',
is_active: true,
is_superuser: false,
})
).rejects.toThrow('Failed to create user');
@@ -536,7 +533,6 @@ describe('useAdmin hooks', () => {
await result.current.mutateAsync({
userId: '1',
userData: {
email: 'updated@example.com',
first_name: 'Updated',
},
});
@@ -545,7 +541,6 @@ describe('useAdmin hooks', () => {
expect(mockUpdateUser).toHaveBeenCalledWith({
path: { user_id: '1' },
body: {
email: 'updated@example.com',
first_name: 'Updated',
},
throwOnError: false,
@@ -561,7 +556,7 @@ describe('useAdmin hooks', () => {
await expect(
result.current.mutateAsync({
userId: '1',
userData: { email: 'test@example.com' },
userData: { first_name: 'Test' },
})
).rejects.toThrow('Failed to update user');
});