xpeditis2.0/apps/frontend/app/dashboard/settings
David b2f5d9968d fix: repair user management CRUD operations (create, update, delete)
Problems Fixed:

1. **User Creation (Invite)**
   - ❌ Missing password field (required by API)
   - ❌ Hardcoded organizationId 'default-org-id'
   - ❌ Wrong role format (lowercase instead of ADMIN/USER/MANAGER)
   - ✅ Now uses currentUser.organizationId from auth context
   - ✅ Added password field with validation (min 8 chars)
   - ✅ Fixed role enum to match backend (ADMIN, USER, MANAGER, VIEWER)

2. **Role Change (PATCH)**
   - ❌ Used 'as any' masking type errors
   - ❌ Lowercase role values
   - ✅ Proper typing with uppercase roles
   - ✅ Added success/error feedback
   - ✅ Disabled state during mutation

3. **Toggle Active (PATCH)**
   - ✅ Was working but added better feedback
   - ✅ Added disabled state during mutation

4. **Delete User (DELETE)**
   - ✅ Was working but added better feedback
   - ✅ Added disabled state during mutation

5. **UI Improvements**
   - Added success messages with auto-dismiss (3s)
   - Added error messages with auto-dismiss (5s)
   - Added loading states on all action buttons
   - Fixed role badge colors to use uppercase keys
   - Better form validation before API call

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 23:35:10 +01:00
..
organization add page organisation 2025-11-04 23:19:25 +01:00
users fix: repair user management CRUD operations (create, update, delete) 2025-11-20 23:35:10 +01:00