hngprojects / hng_boilerplate_expressjs

75 stars 85 forks source link

[FEAT] API End point for delete product for authenticated users #130

Open ugojo opened 3 months ago

ugojo commented 3 months ago

Description

Develop API endpoint that delete product from database. which restricts the deletion of products to authenticated users only. This is to ensure the security and integrity of our product data.

Endpoint Feature

Acceptance Criteria

Response Example:

 {
   "status": "success",
   "status_code": 204,
   "message": "Product deleted successfully."
 }

Authentication and Authorization:

Implementation Details:

Error Handling:

 {
    "status": "Bad Request",
    "status_code": 401,
    "message": "Authentication required."
 }
 {
     "status": "Not Found",
     "status_code": 404,
     "message": "Product not found."
 }

Performance and Security

Performance Considerations

Security Concerns:

Documentation

API Documentation:

Testing Requirements

Unit Tests

Identify dependencies on other tasks or systems, such as user authentication.

incredible-phoenix246 commented 3 months ago

@AdeGneus check this

AdeGneus commented 3 months ago

You wrote an issue for a DELETE endpoint only to add PUT method in the acceptance criteria. The responses should follow this format:

{
"status": "success",
"status_code": 204,
"message": "Product deleted successfully"
}
AdeGneus commented 3 months ago

Ensure that you format the markdown properly

ugojo commented 3 months ago

Ensure that you format the markdown properly

I have implemented the changes , please confirm

AdeGneus commented 3 months ago

@ugojo use checkbox for the acceptance criteria