Skip to content

Commit

Permalink
filter relationships when baseEntity is series
Browse files Browse the repository at this point in the history
when the base entity is a Series, we need to filter out relationshipType 70 - 74. As this relationships will be added via the series editor, we don't want to show them in the relationship modal.
  • Loading branch information
akashgp09 committed Aug 3, 2021
1 parent fd718f5 commit 64de8c6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ class RelationshipModal
const relationships = generateRelationshipSelection(
relationshipTypes, baseEntity, otherEntity
);
if (baseEntity.type === 'Series') {
// when the base entity is Series, we need to remove relationshipType 70 - 74.
// As this relationships will be added via the series editor,
// we don't want to show them in the relationship modal.
_.remove(relationships, (relationship) => relationship.relationshipType.id > 69 && relationship.relationshipType.id < 75);
}

return (
<FormGroup>
Expand Down

0 comments on commit 64de8c6

Please sign in to comment.