Replace all instances of process.env.NEXT_PUBLIC_API_URL with
API_BASE_URL constant for consistency and to ensure the API URL
is properly defined at runtime.
Files updated:
- app/admin/marketing-data/page.tsx
- app/admin/tirages/page.tsx
- app/employe/dashboard/page.tsx
- app/employe/gains-client/page.tsx
- app/employe/historique/page.tsx
- components/admin/TicketManagement.tsx
This fixes the "undefined" API URL issue that was preventing
API calls from working correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fix property access to match the Ticket type definition:
- ticket.user_name → ticket.user?.firstName + lastName
- ticket.user_email → ticket.user?.email
- ticket.prize_name → ticket.prize?.name
- ticket.played_at → ticket.playedAt
The Ticket type uses camelCase and nested objects (user, prize),
not snake_case flat properties.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add Record<string, React.ReactElement> type to badges object to allow
dynamic string indexing in app/employe/verification/page.tsx.
This matches the fix already applied to page-new.tsx and resolves the
TypeScript compilation error.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add Record<string, React.ReactElement> type to badges object to allow
dynamic string indexing. This fixes TypeScript error where status string
parameter cannot be used to index the badges object.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Change validateTicket action parameters from lowercase "validate"/"reject"
to uppercase "APPROVE"/"REJECT" to match the function signature.
The employeeService.validateTicket function expects action type of
'APPROVE' | 'REJECT', not 'validate' | 'reject'.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove invalid comparisons against lowercase 'employee' role that don't exist
in the User type. The role type only includes uppercase 'EMPLOYEE'.
Fixed in:
- app/employe/dashboard/page.tsx (lines 42, 117)
- app/employe/layout.tsx (lines 28, 48)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>