feat: refactor GET /api/artists to use auth-derived accountId#217
Conversation
Replace unauthenticated accountId query param with validateAuthContext + buildGetArtistsParams pattern. No organization_id now returns personal artists only. Remove personal query param. - Add buildGetArtistsParams with 8 passing tests - Add validateGetArtistsRequest (Zod + auth + builder) - Update getArtistsHandler to use new validation - Delete validateArtistsQuery (replaced) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
GET /api/artiststo usevalidateAuthContext→buildGetArtistsParamspattern (matching chats, pulses, sandboxes, organizations)accountIdquery paramorganization_idnow returns personal artists only (was previously all artists)personalquery param (no longer needed)buildGetArtistsParamswith 8 passing unit testsTest plan
pnpm test lib/artists/__tests__/buildGetArtistsParams.test.ts— 8/8 passingrecoup artists listCLI returns personal artistscurl -H "x-api-key: $KEY" ".../api/artists?organization_id=<uuid>"returns org artistscurl ".../api/artists"returns 401🤖 Generated with Claude Code