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> |
||
|---|---|---|
| .. | ||
| page.tsx | ||