public async Task <IActionResult> Update(Idea model)
        {
            try
            {
                await _ideaService.Update(model);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> Update(long id, [FromBody] UpdateIdeaRequestViewModel updateIdeaViewModel)
        {
            if (ModelState.IsValid)
            {
                Idea item = IdeaModelMapper.BuildIdeaModel(updateIdeaViewModel);

                await _ideaService.Update(item);

                return(new NoContentResult());
            }

            return(Error(ModelState));
        }