hngprojects / hng_boilerplate_csharp_web

https://api-csharp.boilerplate.hng.tech
Apache License 2.0
79 stars 42 forks source link

chore(product): modified the delete and update product #363

Closed Reliable25 closed 2 weeks ago

Reliable25 commented 2 weeks ago

Description

This PR introduces an endpoint for updating a product by its ID for authenticated users, an endpoint for allowing authenticated users to delete a product by its unique ID and also an endpoint for allowing an authenticated user to remove another user from an organization based on the organization ID and user ID. It also includes proper error handling and response types for various scenarios.

Closes #issue_number_here

Changes proposed

What were you told to do?

  1. Implement an endpoint to remove a user from an organization by providing the organization ID and user ID.
  2. Modified the response body for delete and update product
  3. Modified the get user in an organization to be able to get user you invite to an organization also

What did you do?

  1. Added the Necessary Response Types and Status Codes to the Controller Action: 200 OK: For successful deletion, returning a message and a boolean value. 404 Not Found: If the product is not found, returning a detailed error message. 400 Bad Request: For any exceptions that may occur during the deletion process.

    Check List (Check all the applicable boxes)

🚨Please review the contribution guideline for this repository.

Screenshots/Videos