Example #1
0
        public async Task <UserKudosViewModel> GetUserKudosInformationById(string id = null)
        {
            id ??= User.Identity.GetUserId();

            var userKudosDto = await _kudosService.GetUserKudosInformationByIdAsync(id, GetUserAndOrganization().OrganizationId);

            var userKudosViewModel = _mapper.Map <UserKudosDto, UserKudosViewModel>(userKudosDto);

            var monthlyStatistics = await _kudosService.GetMonthlyKudosStatisticsAsync(id);

            userKudosViewModel.SentKudos      = monthlyStatistics[0];
            userKudosViewModel.AvailableKudos = monthlyStatistics[1];

            return(userKudosViewModel);
        }