garden-stream / garden

shared resources
0 stars 2 forks source link

Delete action on user endpoint #12

Closed keawade closed 4 years ago

keawade commented 7 years ago

Would allow a user to delete their account.

Would need to go through the deleting user's following collection and unfollow each user so the deleting user will be removed from the other user's followers collection.

NathanBland commented 7 years ago

This gets into cascading deletes, which I don't like the idea of, but is probably needed here.

https://docs.mongodb.com/v3.2/reference/method/db.collection.update/

Seems like the way to go here...

NathanBland commented 7 years ago

To add to this...

Do we want a hard delete, or do we want to mark a user as deleted, which would give them the option of recovering their account within a time frame?

keawade commented 7 years ago

Probably hard delete? At least for 1.0. We can save the soft delete for later if we care.

NathanBland commented 7 years ago

I think soft-delete is actually easier... Because then I don't have to do a cascading delete.

keawade commented 7 years ago

Isn't a soft delete just a delayed and potentially reversible hard delete?

NathanBland commented 7 years ago

Basically, I'd add a Boolean flag on the user that was isDeleted, and filter on it.

keawade commented 7 years ago

Sure but you still have to actually delete it.

NathanBland commented 7 years ago

Do you?

As far as anything else is concerned, your account is gone, but you can reactivate it.

keawade commented 7 years ago

You don't have too, but we probably should.