Skip to content

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

Open
sweetmantech wants to merge 1 commit intotestfrom
sweetmantech/myc-4212-api-get-apiartists-update-account_id-similar-to-apisandbox
Open

feat: refactor GET /api/artists to use auth-derived accountId#217
sweetmantech wants to merge 1 commit intotestfrom
sweetmantech/myc-4212-api-get-apiartists-update-account_id-similar-to-apisandbox

Conversation

@sweetmantech
Copy link
Contributor

Summary

  • Refactored GET /api/artists to use validateAuthContextbuildGetArtistsParams 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

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>
@vercel
Copy link
Contributor

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Feb 10, 2026 11:14pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sweetmantech/myc-4212-api-get-apiartists-update-account_id-similar-to-apisandbox

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant