File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
web-ui/src/components/reviews Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,19 @@ const TeamReviews = ({ onBack, periodId }) => {
266266 // Get the list of review assignments from the server to ensure that we are
267267 // reflecting what was actually created.
268268 res = await getReviewAssignments ( periodId , csrf ) ;
269- const assignments = res . error ? [ ] : res . payload . data ;
269+ let assignments = res . error ? [ ] : res . payload . data ;
270+
271+ // Remove review assignments for members no longer selected.
272+ for ( let assignment of assignments ) {
273+ if ( ! teamMembers . find ( m => m . id == assignment . revieweeId ) ) {
274+ // Delete review assignments if we do not have the matching member.
275+ await removeReviewAssignment ( assignment . id , csrf ) ;
276+ }
277+ }
278+
279+ // Get the review assignments from the server one more time.
280+ res = await getReviewAssignments ( periodId , csrf ) ;
281+ assignments = res . error ? [ ] : res . payload . data ;
270282
271283 // Update our reactive assignment and member lists.
272284 setAssignments ( assignments ) ;
You can’t perform that action at this time.
0 commit comments