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

            return(Ok(ConvertToServiceLayerUser(user)));
        }
Example #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)));
        }
Example #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());
        }
Example #5
0
        public IHttpActionResult DeleteById()
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();

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

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

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

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

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

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

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

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

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

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

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

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

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