[Publisher][Bug] Alternate Solution: Fix bug where adding team members to the admin panel clears out all other team members #1529
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
Alternative solution to #1528 - this is my preferred solution. Explained more here:
https://www.loom.com/share/b657651b698b4430ac2ce3711b755b35
Fix bug where adding team members to the admin panel clears out all other team members due to recent optimizations of fetching team members separately.
This issue was raised by CSG members who noticed that adding a team member to an agency resulted in clearing out all other team members from the agency aside from the one recently added. Because we now fetch team members separately and ONLY when an agency card is clicked vs. before where they were populated for each agency immediately after the admin panel loads, we need to await the fetch of team members before updating them in the admin panel so all references to the team members will be the freshly fetched list.
Follow up TODO: Add unit tests to cover this area
Type of change
Related issues
Closes #XXXX
Checklists
Development
This box MUST be checked by the submitter prior to merging:
These boxes should be checked by the submitter prior to merging:
Code review
These boxes should be checked by reviewers prior to merging: