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 authored and svenvandescheur committed Jun 11, 2024
1 parent 2548c27 commit a2fa8de
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 a2fa8de

Please sign in to comment.