public async Task AddModerator(string moderatorTwitchUsername) { var model = new AddModeratorModel { ModeratorTwitchUsername = moderatorTwitchUsername }; Channel = await apiGateway.Post <ChannelModel, AddModeratorModel>(model, "channels", routeValues : new string[] { CurrentlySelectedChannelName, "moderators" }).ConfigureAwait(false); NotifyStateChanged(); }
public async Task <IActionResult> AddModerator([FromRoute] string channelName, [FromBody] AddModeratorModel model) { var result = await channelService.AddModeratorToChannel(channelName, model.ModeratorTwitchUsername, ApplicationContext).ConfigureAwait(false); if (result.State == ResultState.AccessDenied) { return(Unauthorized()); } if (result.State == ResultState.NoContent) { return(NoContent()); } return(Ok(result.Data.Map())); }