Ejemplo n.º 1
0
        public async Task <IActionResult> Delete([FromRoute] int productImageId)
        {
            var productImage = await _productImageService.GetByIdAsync(productImageId);

            if (productImage == null)
            {
                return(NotFound());
            }

            var isDeleted = await _productImageService.DeleteAsync(productImage);

            if (!isDeleted)
            {
                return(BadRequest("Xoá hình ảnh không thành công"));
            }

            return(NoContent());
        }