Example #1
0
        public async Task <ActionResult <IEnumerable <ConferenceForIndividualResponse> > > GetConferencesForIndividual()
        {
            _logger.LogDebug("GetConferencesForIndividual");
            try
            {
                var username = User.Identity.Name;
                var conferencesForIndividual = await _videoApiClient.GetConferencesTodayForIndividualByUsernameAsync(username);

                conferencesForIndividual = conferencesForIndividual.Where(c => ConferenceHelper.HasNotPassed(c.Status, c.Closed_date_time)).ToList();
                var response = conferencesForIndividual
                               .Select(ConferenceForIndividualResponseMapper.MapConferenceSummaryToModel).ToList();
                return(Ok(response));
            }
            catch (VideoApiException e)
            {
                _logger.LogError(e, "Unable to get conferences for user");
                return(StatusCode(e.StatusCode, e.Response));
            }
        }