feat: added endpoint DeleteProduct
- fix: adapters package updated - fix: status property renamed
This commit is contained in:
		| @@ -202,5 +202,30 @@ namespace Core.Inventory.DAL.API.Controllers | ||||
|  | ||||
|             return Ok(result); | ||||
|         } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Deletes a Product by its MongoDB identifier. | ||||
|         /// </summary> | ||||
|         /// <param name="id">The Product MongoDB identifier.</param> | ||||
|         /// <returns>The result of the delete operation.</returns> | ||||
|         /// <response code="200">The Product deleted successfully.</response> | ||||
|         /// <response code="404">The Product not found.</response> | ||||
|         /// <response code="500">The service internal error.</response> | ||||
|         [HttpDelete] | ||||
|         [Route("{id}")] | ||||
|         [Consumes(MimeTypes.ApplicationJson)] | ||||
|         [Produces(MimeTypes.ApplicationJson)] | ||||
|         [ProducesResponseType(typeof(bool), StatusCodes.Status200OK)] | ||||
|         public async Task<IActionResult> DeleteProduct([FromRoute] string id, CancellationToken cancellationToken) | ||||
|         { | ||||
|             var result = await service.DeleteProduct(id, cancellationToken).ConfigureAwait(false); | ||||
|              | ||||
|             if (!result) | ||||
|             { | ||||
|                 return NotFound("Product not found"); | ||||
|             } | ||||
|  | ||||
|             return Ok(result); | ||||
|         } | ||||
|     } | ||||
| }  | ||||
		Reference in New Issue
	
	Block a user