- Add permissions and roles multi-select to admin user form
- Update admin user models to include permissions and roles arrays
- Make permissions list page read-only by removing CRUD actions
- Integrate MultiSelectAutocomplete for better UX
- Add routes for admin users, roles, and permissions management
- Update sidebar with System Management section
- Remove undeveloped menu items for cleaner demo
- Add proper route protection and loading states
- Export new permission management types
- Add permissions CRUD operations (list, create, edit, delete)
- Implement proper API request/response handling
- Create hooks and request functions following established pattern
- Add TypeScript interfaces and form validation
- Include proper error handling and user feedback
- Add admin users CRUD operations (list, create, edit, delete)
- Implement proper API response structure handling (admin_user vs user)
- Add form validation with conditional password requirement (optional in edit mode)
- Create reusable hooks and request functions following established pattern
- Add TypeScript interfaces and proper error handling
- Include debug logging for API responses
- Add defensive programming for null API responses
- Handle roles array being null in API response
- Fix role permissions array handling
- Add proper fallbacks to prevent 'map is not a function' errors
- Add all admin users, roles, and permissions API endpoints
- Update backend base URL to staging environment
- Disable React Query cache for fresh data on all requests
- Add query keys for new endpoints
- Update AuthContext with new login response structure
- Add isLoading state to prevent premature redirects
- Implement proper session restoration from localStorage
- Update permission checking logic (id=1 = super admin)
- Fix login form to use new API structure
- Store tokens, user info, and permissions in localStorage
- Add console.log to debug roles API response structure
- Handle different API response formats (results, items, data fields)
- Add fallback to empty array when API fails or returns non-array
- Fix roles?.map error by ensuring roles is always an array
- Handle backend API not working scenario
- Update AdminUser interface to match new API response structure
- Remove permissions/roles from AdminUser (they come separately)
- Update hasPermission logic: id=1 (AdminAll) = Super Admin access
- Fix localStorage handling to remove admin_all_permissions key
- Super Admin (permission id=1) now has access to everything
- Other users checked against their specific permissions
- Remove withCredentials from axios config to prevent CORS errors
- API authentication will be handled via Authorization header
- Tested working with Postman curl command
- Replace import.meta.env.VITE_APP_BACKEND_BASE_URL with API_GATE_WAY constant
- Ensure API URLs are generated correctly without undefined segments
- Fix API endpoint URL construction
- Add all roles routes to App.tsx
- Add roles menu item to sidebar with Shield icon
- Update user display to use AdminUser properties
- Fix TypeScript compatibility issues with new auth types
- Two-column layout for assigned vs available permissions
- Real-time permission assignment and removal
- Confirmation modals for destructive actions
- Complete permissions list with descriptions
- Visual distinction between assigned and available permissions
- Complete role information display
- Statistics and metadata sections
- List of assigned permissions
- Quick access to edit and permissions management
- Responsive layout with proper Persian typography
- Unified form for both create and edit operations
- Form validation with Yup schema
- Auto-populate fields in edit mode
- Proper navigation and loading states
- Persian validation messages
- Complete table view with role information
- CRUD operations (view, edit, delete, permissions)
- Delete confirmation modal
- Responsive design with proper Persian RTL
- Loading states and error handling
- Add comprehensive role and permission models
- Add all CRUD API request functions
- Add custom hooks with React Query integration
- Support role permissions management
- Follow established development pattern
- Add axios-based HTTP service with interceptors
- Add authentication header management
- Add APIUrlGenerator for dynamic URL building
- Support for all HTTP methods (GET, POST, PUT, DELETE, etc.)
- Error handling and automatic logout on 401/403
- Add draft API request functions
- Add custom hooks for draft data fetching
- Update React Query to use @tanstack/react-query
- Follow established development pattern
- Replace direct AuthContext usage with useLogin hook
- Change form field from email to username
- Add proper error handling and navigation
- Follow separation of concerns pattern
- Remove login logic from context (moved to custom hook)
- Add restoreSession functionality
- Update state management for new auth response structure
- Add permission checking by ID and title
- Manage access_token and refresh_token separately