You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix critical production issues: API validation schema & client response mismatch
Backend (API):
- Fix validation.ts: Schema field mismatches (problem.answer → expectedAnswer, problem.type → typeId)
- Fix problems.ts: Implement hint endpoint with query parameter approach (?hint=true&level=N) to bypass route shadowing
Frontend (Web):
- Fix api-client.ts Zod schemas to match actual API response fields (typeId, expectedAnswer, hint fields)
- Add field normalization: Map API fields (typeId→type, expectedAnswer→answer) for component compatibility
- Fix ProblemCard.tsx: Handle both typeId and type fields for robust backward compatibility
- Update hint schema transformer and getHint function to use new query parameter endpoint
Results:
✅ Practice mode now loads problems successfully (10+ questions displayed)
✅ Validation API returns proper XP calculations and feedback
✅ Hint system functional with progressive difficulty levels
✅ All components compile without TypeScript errors
✅ Deployed to Cloudflare Workers production
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments