Esempio n. 1
0
        public async Task <IActionResult> Update([FromBody] ProfileResponse profile)
        {
            if (profile == null)
            {
                throw new ArgumentNullException(nameof(profile));
            }

            var subject = User.GetSubject();

            try
            {
                var parameter = profile.ToParameter();
                parameter.Subject = subject;
                if (!await _profileActions.Update(parameter))
                {
                    return(this.GetError(Constants.Errors.ErrUpdateProfile, HttpStatusCode.InternalServerError));
                }

                return(Ok());
            }
            catch (Exception ex)
            {
                return(this.GetError(ex.Message, HttpStatusCode.InternalServerError));
            }
        }