Skip to content

Yu Yan taking over for Ujjwal - fix: Removed userId of deleted users from task->resources and teams->members#1748

Closed
PipKcK wants to merge 1 commit intodevelopmentfrom
ujjwal-fix/removing-deleted-users-from-other-models
Closed

Yu Yan taking over for Ujjwal - fix: Removed userId of deleted users from task->resources and teams->members#1748
PipKcK wants to merge 1 commit intodevelopmentfrom
ujjwal-fix/removing-deleted-users-from-other-models

Conversation

@PipKcK
Copy link
Copy Markdown

@PipKcK PipKcK commented Sep 24, 2025

Description

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):

None

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}
  }
}
image
  1. Verify that those userIds are deleted from the collections (And are no longer visible)

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Dec 15, 2025
Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Ujjwal,

I have tried to review your PR locally but was unable to add the new user to the task even though i could add them to the teams. Could you please look into it and let me know if i am not doing any step wrong as even the names are not popping up in the Resources.

Testpr1748.mp4

@VijayAnirudh
Copy link
Copy Markdown

Hi Ujjwal,
I created a user and project, and added that user. When I reopened the project to check if the user was assigned, I noticed there were no members showing in the project (please see the timers in the images for reference). I did see the userID in the URL and used that to initiate a delete request from Postman. On the frontend, I’m currently testing on the development branch — could you let me know if I’m missing something or doing anything incorrectly?
I've created a user and project, added that user :
image
When I opened the project again to test if the user was assigned, there's no members in that project (please check timers for reference in the images) :
image
However, there's userID in the url with the help of it, initiated a delete request from postman:
image

@one-community one-community changed the title Ujjwal - fix: Removed userId of deleted users from task->resources and teams->members Yu Yan taking over for Ujjwal - fix: Removed userId of deleted users from task->resources and teams->members Feb 27, 2026
@one-community
Copy link
Copy Markdown
Member

Redone with: #2149

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

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants