public async Task<IActionResult> Update([FromForm] ProductUpdateRequest request)
 {
     var affectedResult = await _manageProductService.Update(request);
     if (affectedResult == 0)
         return BadRequest();
     return Ok();
 }
Example #2
0
        public async Task <IActionResult> Update([FromForm] ProductEditRequest request)
        {
            var result = await _manageProductService.Update(request);

            if (result == 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }
        public async Task <IActionResult> update([FromForm] ProductUpdateRequest request)
        {
            var productId = await _manageProductService.Update(request);

            if (productId == 0)
            {
                return(BadRequest());
            }
            var product = await _manageProductService.getProductById(productId);

            return(Ok(new { message = "Cập nhập sản phẩm thành công!", product }));
        }
Example #4
0
        public async Task <IActionResult> Update([FromForm] ProductUpdateRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var affectedResult = await _manageProductService.Update(request);

            if (affectedResult == 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }