Skip to content

Commit

Permalink
fix(openalex): On deletetion, push ROR in affiliation removeList
Browse files Browse the repository at this point in the history
only if it is a ror in the current affiliation
  • Loading branch information
annelhote committed Dec 5, 2024
1 parent e039815 commit aaa66b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/pages/openalex-affiliations/results/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit aaa66b3

Please sign in to comment.