示例#1
0
        public IHttpActionResult UpdateById([FromBody] UserUpdateDetails updateDetails)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();
            var  user = _context.Users.UpdateById(authenticatedUserId, updateDetails);

            return(Ok(ConvertToServiceLayerUser(user)));
        }
示例#2
0
        public IHttpActionResult UpdatePasswordById([FromBody] Service.PasswordUpdate passwordUpdate)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();
            var  user = _context.Users.UpdatePasswordById(authenticatedUserId, passwordUpdate.Password);

            return(Ok(ConvertToServiceLayerUser(user)));
        }
示例#3
0
        public Service.User GetCurrentUser()
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();
            var  user = _context.Users.GetById(authenticatedUserId);

            return(ConvertToServiceLayerUser(user));
        }
        public IHttpActionResult DeleteById(Guid id)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            _context.Projects.DeleteById(id, authenticatedUserId);
            return(Ok());
        }
示例#5
0
        public IHttpActionResult DeleteById()
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            _context.Users.DeleteById(authenticatedUserId);
            return(Ok());
        }
示例#6
0
 public bool IsLoggedIn()
 {
     try
     {
         Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#7
0
        public Translation Add([FromBody] Translation translation)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(_context.Translations.Add(translation, authenticatedUserId));
        }
示例#8
0
        public Vote UpdateById(Guid translationId, [FromBody] Vote vote)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(_context.Votes.UpdateById(translationId, vote, authenticatedUserId));
        }
示例#9
0
        public void DeleteById(Guid translationId)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            _context.Votes.DeleteById(translationId, authenticatedUserId);
        }
示例#10
0
        public Vote GetCurrentUserVoteByTranslationId(Guid translationId)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(_context.Votes.GetById(authenticatedUserId, translationId));
        }
示例#11
0
        public Vote Add([FromBody] Vote vote)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(_context.Votes.Add(vote, authenticatedUserId));
        }
示例#12
0
        public IHttpActionResult UpdateById(Guid id, [FromBody] Project project)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(Ok(_context.Projects.UpdateById(id, project, authenticatedUserId)));
        }
示例#13
0
        public string GetRole(Guid id)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(_context.Translations.GetRole(id, authenticatedUserId));
        }
示例#14
0
        public IHttpActionResult Add([FromBody] Project project)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(Ok(_context.Projects.Add(project, authenticatedUserId)));
        }
示例#15
0
        public Translation UpdateById(Guid id, [FromBody] Translation translation)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(_context.Translations.UpdateById(id, translation, authenticatedUserId));
        }
示例#16
0
        public void DeleteById(Guid id)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            _context.Translations.DeleteById(id, authenticatedUserId);
        }
示例#17
0
        public IHttpActionResult Add([FromBody] Phrase phrase)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(Ok(_context.Phrases.Add(phrase, authenticatedUserId)));
        }
示例#18
0
        public IHttpActionResult UpdateById(Guid id, [FromBody] Phrase phrase)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

            return(Ok(_context.Phrases.UpdateById(id, phrase, authenticatedUserId)));
        }