Skip to content

Commit

Permalink
🐛 [#45] Handle case in which a reviewer is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Jun 7, 2024
1 parent faf3dd2 commit 06a3503
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/pages/destructionlist/DestructionListDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ export async function destructionListUpdateAction({
const data: DestructionListUpdateData = {};

if (assigneesData) {
data.assignees = assigneesData.map((id, index) => ({
user: Number(id),
order: index,
}));
data.assignees = assigneesData
.filter((id) => id !== "") // Case in which a reviewer is removed
.map((id, index) => ({
user: Number(id),
order: index,
}));
}

if (items) {
Expand Down

0 comments on commit 06a3503

Please sign in to comment.