Joystream / youtube-synch

YouTube Synchronization
11 stars 9 forks source link

Create new endpoint for referrals info #269

Closed WRadoslaw closed 11 months ago

WRadoslaw commented 11 months ago

As with ypp 2 we want to show referred channels table to users that are not signed up yet as well as normal ypp members.

The problem with current solution is that now even if a channel is not signed in we will return data from channels/:id endpoint with a smaller payload (only referredChannels and syncStatus), Atlas is not adjusted for this kind of payload and relies heavily on the assumption that if a channel is not signed up it will receive 400, and when it receives 200 it will be with whole ypp channel DTO.

I would be behind creating a new endpoint referrals/:id (id - joystream channel id) that will return an array of referred channels for a given on-chain channel. This way we can avoid re-writing dashboard logic mentioned in the paragraph above and just add new logic for referral table alone that will handle both non ypp and ypp channels