morph fix for release 1.4 (#14029)

DataLoader Specific update du to Morph relations that have many rows

Fixes https://github.com/twentyhq/twenty/issues/14018
This commit is contained in:
Guillim
2025-08-21 16:43:14 +02:00
committed by GitHub
parent 707043c3ba
commit 35df56e7d8
3 changed files with 41 additions and 6 deletions
@@ -1,7 +1,7 @@
import { type FieldMetadataDTO } from 'src/engine/metadata-modules/field-metadata/dtos/field-metadata.dto';
export const filterMorphRelationDuplicateFieldsDTO = (
fields: FieldMetadataDTO[],
export const filterMorphRelationDuplicateFieldsDTO = <
T extends { name: string; id: string },
>(
fields: T[],
) => {
return fields.filter((currentField) => {
return !fields.some(