public async Task <IActionResult> Update(int trademarkId, [FromForm] TrademarkRequest request) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _trademarkService.Update(trademarkId, request); if (!result.IsSuccessed) { return(BadRequest(result.Message)); } return(Ok()); }
public IActionResult Update(Trademark trademark, int id) { var newTrademark = new Trademark { Id = id, Name = trademark.Name, Image = trademark.Image, Description = trademark.Description, Status = 1 }; var result = _trademarkService.Update(newTrademark); if (result.Success) { return(Ok(result.Message)); } return(BadRequest(result.Message)); }