Exemplo n.º 1
0
        public IHttpActionResult Edit(EditPlayerData data)
        {
            VerifyPermission(Permissions.Update, Modules.PlayerManager);

            if (ModelState.IsValid == false)
            {
                return(Ok(ErrorResponse()));
            }

            var validationResult = _commands.ValidateThatPlayerInfoCanBeEdited(data);

            if (!validationResult.IsValid)
            {
                return(Ok(ValidationExceptionResponse(validationResult.Errors)));
            }

            _commands.Edit(data);
            return(Ok(new { Result = "success" }));
        }