public async Task <IActionResult> PutComment(int id, PublicApi.v1.DTO.Comment comment) { if (id != comment.Id) { return(BadRequest()); } _bll.Comments.Update(CommentMapper.MapFromExternal(comment)); await _bll.SaveChangesAsync(); return(NoContent()); }
public async Task <IActionResult> PutComment(int id, PublicApi.v1.DTO.Comment comment) { if (!ModelState.IsValid || id != comment.Id || comment.ShopId != User.GetShopId()) { return(BadRequest()); } _bll.Comments.Update(CommentMapper.MapFromExternal(comment)); await _bll.SaveChangesAsync(); return(NoContent()); }