feat: refactor GET /api/artists to use auth-derived accountId
Ā
SW
7mo ago+291+291+012345678901234567890123456789-69-69-01234567890123456789
Summary
- Refactored
GET /api/artiststo usevalidateAuthContextābuildGetArtistsParamspattern (matching chats, pulses, sandboxes, organizations) - Account ID is now derived from authentication ā no more unauthenticated
accountIdquery param - No
organization_idnow returns personal artists only (was previously all artists) - Removed
personalquery param (no longer needed) - Added
buildGetArtistsParamswith 8 passing unit tests
Test plan
-
pnpm test lib/artists/__tests__/buildGetArtistsParams.test.tsā 8/8 passing -
recoup artists listCLI returns personal artists -
curl -H "x-api-key: $KEY" ".../api/artists?organization_id=<uuid>"returns org artists -
curl ".../api/artists"returns 401
š¤ Generated with Claude Code