Skip to content

Commit

Permalink
Avoid filtering out relationships where entities support filtering (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarHawk authored Jun 6, 2024
1 parent 38a0275 commit 7a4d260
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion generators/client/support/filter-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import { type Entity } from '../../base-application/index.js';
export const filterEntityPropertiesForClient = (entity: Entity): Entity => ({
...entity,
fields: entity.fields.filter(field => !field.skipClient),
relationships: entity.relationships.filter(rel => !rel.skipClient && (rel.persistableRelationship || rel.relationshipEagerLoad)),
relationships: entity.relationships.filter(
rel => !(rel.skipClient ?? !(rel.persistableRelationship || rel.relationshipEagerLoad || rel.otherEntity?.jpaMetamodelFiltering)),
),
});

/**
Expand Down

0 comments on commit 7a4d260

Please sign in to comment.