Skip to content

Conversation

@DanThePol
Copy link
Contributor

  • 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

@albertfares albertfares self-requested a review June 2, 2024 17:46
}
.addOnFailureListener { exception ->
Log.w(TAG, "Error getting documents.", exception)
Log.w(TAG, "Error getting all events", exception)
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well structured logic

Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, well structured logic

Comment on lines +149 to +150
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice documentation!

Comment on lines +230 to +231
* 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good warnings

Copy link
Contributor

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

Copy link
Contributor

@albertfares albertfares left a 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!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants