fix: auto-strip /api/ prefix in api client + document convention
The api client now calls normalizePath() to strip accidental /api/ prefixes. This prevents the recurring /api/api/ double-prefix bug. Added convention note to .claude/CLAUDE.md so future workers know.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
- ESLint must pass before committing
|
||||
- Import aliases: `@/` maps to `src/`
|
||||
- Bun as package manager (not npm/yarn/pnpm)
|
||||
- **API paths: NEVER include `/api/` prefix.** The `api` client in `lib/api.ts` already has `baseUrl="/api"`. Write `api.get("/cases")` NOT `api.get("/api/cases")`. The client auto-strips accidental `/api/` prefixes but don't rely on it.
|
||||
|
||||
## General
|
||||
|
||||
|
||||
Reference in New Issue
Block a user