Пример #1
0
        public async Task <IActionResult> UpdateImage(int productId, [FromForm] ProductImageUpdateRequest request)
        {
            var result = await _manageProductService.UpdateImage(productId, request);

            if (result == 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }
Пример #2
0
        public async Task <IActionResult> UpdateImage(int imageId, [FromForm] ProductImageUpdateRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var result = await _manageProductService.UpdateImage(imageId, request);

            if (result == 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }
Пример #3
0
        public async Task <ActionResult> UpdateImage(int productId, int imageId, [FromForm] ProductImageUpdateRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var image = await _manageProductService.UpdateImage(imageId, request);

            if (productId == 0)
            {
                return(BadRequest());
            }
            //return Created(nameof(GetById), productId);
            //return CreatedAtAction(nameof(GetImageById), new { id = imageId }, image);
            return(Ok());
        }