update ypp suspension status#44
Conversation
| } | ||
|
|
||
| @Put(':joystreamChannelId') | ||
| @Put('/yt-syncing/:joystreamChannelId') |
There was a problem hiding this comment.
yt-syncing is not a resource, so it shouldn't be in the path. I suggest we just keep it /channels/:channelId
There was a problem hiding this comment.
Right, I also initially thought of keeping the endpoint like /channels/:channelId. However, we actually need two different endpoints for changing two different fields/values (shouldBeIngested & isSuspended) of the same resource (which is the channel record) by different actors, having different privileges.
So maybe two endpoints like the following make sense?
/channels/ingest/:channelId-> callable by channel owners for changing channel's ingestion status, would changeshouldBeIngestedfield/channels/suspend/:channelId-> callable by YPP infra owner to suspend channel's YPP status, would changeisSuspendedfield
There was a problem hiding this comment.
Sure sounds good but I would change the order to /channels/:channelId/ingest and same for suspend
| description: `Authenticated endpoint to suspend given channel/s from YPP program`, | ||
| }) | ||
| async suspendChannels( | ||
| @Headers('ypp_owner_key') yppOwnerKey: string, |
There was a problem hiding this comment.
I think we should use standard Authorization header for this, it may get special treatment from some clients
| this.channelsService.update({ ...channel, isSuspended, shouldBeIngested: false }) | ||
| } else { | ||
| // if channel suspension is revoked then its YT ingestion/syncing should be resumed | ||
| this.channelsService.update({ ...channel, isSuspended, shouldBeIngested: true }) |
There was a problem hiding this comment.
This one's a bit more tricky - if the user has opt out from YT sync and then got suspended, once they get unsuspended, we probably shouldn't enable YT sync back. WDYT?
There was a problem hiding this comment.
Right, so I think irrespective of the previous YT sync status, whether enabled or disabled, if a channel gets unsuspended, its YT sync should always be in the disabled state. And it should be the responsibility of the channel owner to turn it back on?
implements #34