Scribbie-Notes / notes-app

https://scribbie-notes.vercel.app/
8 stars 20 forks source link

Add API for Deleting User and Associated Notes #51

Closed shubham-mehta-002 closed 43 minutes ago

shubham-mehta-002 commented 11 hours ago

Description: This pull request implements a new API endpoint to facilitate the deletion of a user along with all their associated notes.

Changes Made: New API Endpoint:

Endpoint: DELETE /delete-user

Functionality: Deletes all notes associated with the specified user ID. Deletes the user from the database. Returns a confirmation message.

Authorization Checks: Ensures that only the authenticated user can delete their own account .

Error Handling: Properly handles scenarios where the user does not exist, returning appropriate HTTP status codes and messages.

On successful deletion:

https://github.com/user-attachments/assets/237d53e1-13df-4084-b7ac-af10b04fd01a