Skip to content

Yu Yan - Take over PR #1748 - fix: Removed userId of deleted users from task->resources and teams->members#2149

Open
yany960 wants to merge 4 commits intodevelopmentfrom
yany960-fix/removing-deleted-users-from-models
Open

Yu Yan - Take over PR #1748 - fix: Removed userId of deleted users from task->resources and teams->members#2149
yany960 wants to merge 4 commits intodevelopmentfrom
yany960-fix/removing-deleted-users-from-models

Conversation

@yany960
Copy link
Copy Markdown
Contributor

@yany960 yany960 commented Apr 3, 2026

Description

This PR takes over from PR #1748 (originally by Ujjwal, then Yu Yan).

Users that were deleted were not removed from Projects that they were assigned to. This PR ensures that when a user is deleted, they are also removed from Task->Resources (Which is responsible for Projects) and Teams->Members.

image

Related PRS (if any):

Main changes explained:

  • Modified userProfileController.js's deleteUserProfile function to remove the deleted userIds from other collections (tasks and teams)

How to test:

  1. Check into current branch
  2. Run npm run build and npm start to run this PR locally
  3. Create users to test the fix (Other Links -> User Management -> Create New User)
  4. Add the user to your project task and team
  5. Verify that the userId is visible in tasks and teams collections
Screenshot 2025-09-23 212426
  1. Send the delete user postman request to http://localhost:4500/api/userProfile/{userId_to_delete} with the body:
{
  "userId": {userId_to_delete},
  "option": "delete",
  "requestor": {
    "requestorId": {admin_userId}
  }
}

@one-community one-community changed the title Take over PR #1748 - fix: Removed userId of deleted users from task->resources and teams->members Yu Yan - Take over PR #1748 - fix: Removed userId of deleted users from task->resources and teams->members Apr 10, 2026
Copy link
Copy Markdown

@Rajasrivatsansrinivasan Rajasrivatsansrinivasan left a comment

Choose a reason for hiding this comment

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

Reviewed PR #2149 by Yu Yan. Tested the delete user flow after assigning a test user to both team members and task resources. While the user deletion request succeeds, the deleted user is not fully removed from all referenced collections as expected. This needs further investigation before merge.

Image

@sonarqubecloud
Copy link
Copy Markdown

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.

4 participants