-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Description: Currently, when an admin deletes a user, only the user document is removed from the database. We need to implement a cascade delete so that all artwork associated with the deleted user (i.e., any images they uploaded) is also removed from the database and Cloudinary.
This ensures there’s no orphaned artwork left behind once a user is deleted.
Checklist:
- Update the admin delete user endpoint to find and delete all images associated with the user.
- Remove each image from both MongoDB and Cloudinary.
- Use the user's _id to filter artwork in the ImageModel.
- Extract and delete each image’s public_id from Cloudinary (artists folder if profile pic, or artwork folder if art).
- Handle Cloudinary API errors gracefully (log, skip, and continue deleting others).
- Test to confirm that:
- User is deleted from the DB.
- All of their artwork is removed from the DB.
- All corresponding Cloudinary images are deleted.
- Return a success response with a summary of deleted assets.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels