Пример #1
0
        public async Task UpdateUserConfig(UpdateUserConfigViewModel userConfig)
        {
            var userId = _httpContextAccessor.HttpContext.User.GetClaim(JwtTypes.jti);

            var updated = await _userService.UpdateUserConfig(userConfig, Guid.Parse(userId));

            await _userService.Commit();
        }
Пример #2
0
        public async Task <UserConfiguration> UpdateUserConfig(UpdateUserConfigViewModel userConfig, Guid userId)
        {
            var userConfiguration = await _unitOfWork.UserRepository.GetUserConfiguration(userId);

            userConfiguration.LogOutAfter           = userConfig.LogOutAfter;
            userConfiguration.CommentsDisplayAmount = userConfig.CommentsDisplayAmount;
            userConfiguration.EventsDisplayAmount   = userConfig.EventsDisplayAmount;
            userConfiguration.CalendarPastEvents    = userConfig.CalendarPastEvents;
            userConfiguration.SendEmailNotification = userConfig.SendEmailNotification;
            userConfiguration.Anonymous             = userConfig.Anonymous;
            return(userConfiguration);
        }
Пример #3
0
        public async Task <IActionResult> UpdateUserConfig([FromBody] UpdateUserConfigViewModel userConfig)
        {
            try
            {
                await _accountFacade.UpdateUserConfig(userConfig);

                return(Ok());
            }
            catch (Exception e)
            {
                Response.StatusCode = 500;
                return(Json(e.Message + e.InnerException));
            }
        }