Sweetmantech/myc 3461 api apiartistspro call existing libs to get all artist ids#175
Conversation
WalkthroughThe changes refactor the artist retrieval logic in the ArtistsPro controller by introducing a new Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant H as getArtistsProHandler
participant E as getEnterpriseArtists
participant EA as getAllEnterpriseAccounts
participant SA as getSubscriberAccountEmails
participant AAI as selectAccountArtistIds
participant AE as getArtistEmails
rect rgb(200, 220, 255)
Note over H,AE: New Consolidated Flow
H->>E: getEnterpriseArtists()
par Parallel Fetch
E->>EA: getAllEnterpriseAccounts()
E->>SA: getSubscriberAccountEmails()
and
EA-->>E: enterprise account IDs
SA-->>E: subscriber account emails
end
E->>AAI: selectAccountArtistIds({account_ids})
AAI-->>E: artist IDs for accounts
E-->>H: deduplicated artist list
H->>AE: getArtistEmails(artist_ids)
AE->>AAI: selectAccountArtistIds({artist_id})
AAI-->>AE: account IDs for artist
AE-->>H: artist email data
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used🧬 Code graph analysis (4)lib/enterprise/getEnterpriseArtists.ts (3)
lib/supabase/account_artist_ids/selectAccountArtistIds.ts (1)
lib/supabase/getArtistEmails.ts (1)
controllers/ArtistsProController/getArtistsProHandler.ts (1)
🔇 Additional comments (12)
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 by CodeRabbit