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

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

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

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

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

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

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

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

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

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

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

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

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

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

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