From aaa66b30dea006a6c2eb82d9fb90124a901389ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Thu, 5 Dec 2024 10:41:39 +0100 Subject: [PATCH] fix(openalex): On deletetion, push ROR in affiliation removeList only if it is a ror in the current affiliation --- client/src/pages/openalex-affiliations/results/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/pages/openalex-affiliations/results/index.jsx b/client/src/pages/openalex-affiliations/results/index.jsx index 5fc2506..0489bc1 100644 --- a/client/src/pages/openalex-affiliations/results/index.jsx +++ b/client/src/pages/openalex-affiliations/results/index.jsx @@ -238,14 +238,14 @@ export default function Affiliations() { return { ...affiliation, addList: affiliation.addList.filter((item) => !selectedRorIds.includes(item.rorId)), - removeList: [...new Set([...affiliation.removeList, ...selectedRorIds])], + removeList: [...new Set([...affiliation.removeList, ...selectedRorIds])].filter((item) => affiliation.rors.map((_ror) => _ror.rorId).includes(item)), selected: false, }; } return affiliation; }); setAffiliations(affiliationsTmp); - setRorsToRemove([]); // TODO: Is it still used ? + setRorsToRemove([]); setIsRemoveModalOpen(false); };