Пример #1
0
        public async Task <ActionResult> Update(UpdateCatRequestModel model)
        {
            var userId = _user.GetId();

            var updated = await this._catService.Update(model.Id, model.Description, userId);

            if (!updated)
            {
                return(BadRequest());
            }

            return(Ok());
        }
        public async Task <ActionResult> Update(int id, UpdateCatRequestModel model)
        {
            var userId = this.currentUser.GetId();

            var result = await this.cats.Update(
                id,
                model.Description,
                userId);

            if (result.Failure)
            {
                return(BadRequest());
            }

            return(Ok());
        }