public async Task <ActionResult <Commentary> > PutCommentary(int promotionId, int id, [FromBody] Commentary commentary) { try { return(Ok(await commentsService.EditCommentaryAsync(promotionId, id, commentary))); } catch (InvalidOperationException ex) { return(BadRequest(ex.Message)); } catch (NotFoundItemException ex) { return(NotFound(ex.Message)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }