Example #1
0
        public string Execute(IList <string> parameters)
        {
            var postId = this.coreValidator.IntFromString(parameters[1], "postId");

            var loggedUserId = this.userService.GetLoggedUserId();

            var postToBeEdited = this.postService.FindPostById(postId);

            postToBeEdited.Price = this.coreValidator.DecimalFromString(parameters[2], "price");

            this.postService.VerifyPostOwnerId(postToBeEdited.UserId, loggedUserId);

            var result = postService.EditPostPrice(postToBeEdited);

            return(result);
        }