feat: refactor GET /api/artists to use auth-derived accountId

SW
7mo ago
+291-69

Summary

  • Refactored GET /api/artists to use validateAuthContext → buildGetArtistsParams pattern (matching chats, pulses, sandboxes, organizations)
  • Account ID is now derived from authentication — no more unauthenticated accountId query param
  • No organization_id now returns personal artists only (was previously all artists)
  • Removed personal query param (no longer needed)
  • Added buildGetArtistsParams with 8 passing unit tests

Test plan

  • pnpm test lib/artists/__tests__/buildGetArtistsParams.test.ts — 8/8 passing
  • recoup artists list CLI 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