From 06a3503a42fd52ce62a650f344d0c1a63fd0c7a4 Mon Sep 17 00:00:00 2001 From: SilviaAmAm Date: Wed, 29 May 2024 15:19:05 +0200 Subject: [PATCH] :bug: [#45] Handle case in which a reviewer is removed --- .../pages/destructionlist/DestructionListDetail.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/destructionlist/DestructionListDetail.tsx b/frontend/src/pages/destructionlist/DestructionListDetail.tsx index 549ed40c..b6fe3e2b 100644 --- a/frontend/src/pages/destructionlist/DestructionListDetail.tsx +++ b/frontend/src/pages/destructionlist/DestructionListDetail.tsx @@ -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) {