-
Notifications
You must be signed in to change notification settings - Fork 2
Added possibility to delete a user #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
DanThePol
commented
Jun 2, 2024
- Had to refactor Event and User ViewModels and Repositories to make this possible
- myFavorites user field is now updated when getAllEvents() is called (the logic being that if it contains an event that no longer exists on Firebase, it will no longer crash the app). This was simpler and made more sense to me than fetching all users from the database and removing an event from their myFavorites list if it happened to be there
- Updated function signatures everywhere
| } | ||
| .addOnFailureListener { exception -> | ||
| Log.w(TAG, "Error getting documents.", exception) | ||
| Log.w(TAG, "Error getting all events", exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good clarification
| * @param userID The user ID if there is only one (default is "") | ||
| * @param userIDs The list of user IDs (default is emptyList()) | ||
| */ | ||
| suspend fun leaveEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well structured logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great helper functions to leave and remove an event from the database
| * | ||
| * @param uid the user id | ||
| */ | ||
| fun removeFollowersFollowing(uid: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, well structured logic
| * Remove a user from the database. Caution: This function doesn't update ant lists that need to | ||
| * be updated as a consequence of the deletion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice documentation!
| * Removes eventID from user userID's joined events list. Caution: no checks are performed | ||
| * (don't call this function if the user created the event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good warnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good functions and nice documentation as well
albertfares
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a great start to a useful functionality that will facilitate the use of the app and deletion of users. The helper functions created are well structured and the documentation is well thought. What's left to do is implement the delete account button in the settings screen. Good work!
…Antoine to add confirmation dialogue to delete account and to sign out
|


