예제 #1
0
        public async Task <IActionResult> UpdateIntegration(int id, [FromBody] Integration integration)
        {
            if (integration.IsEnabled)
            {
                switch (integration.Name)
                {
                case "Youtube":
                    if (!youtubeService.IsConfigured())
                    {
                        return(UnprocessableEntity($"Please configure Youtube integration first."));
                    }

                    break;

                case "Twitch":
                    if (!twitchService.IsConfigured())
                    {
                        return(UnprocessableEntity($"Please configure Twitch integration first."));
                    }

                    break;
                }
            }

            await integrationService.UpdateIntegration(id, integration);

            return(NoContent());
        }