Skip to content

The open alternative to Salesforce, designed for AI.

Remove the `as any` casts in 2 files of modules/object-record/record-filter/utils (#28363)

twenty-pr-author[bot]513e67eb607d
diff --git a/packages/twenty-front/src/modules/object-record/record-filter/utils/areCompositeTypeSubFieldsFilterable.ts b/packages/twenty-front/src/modules/object-record/record-filter/utils/areCompositeTypeSubFieldsFilterable.ts
index 52ce04fc6c5..99e607c7fdf 100644
--- a/packages/twenty-front/src/modules/object-record/record-filter/utils/areCompositeTypeSubFieldsFilterable.ts
+++ b/packages/twenty-front/src/modules/object-record/record-filter/utils/areCompositeTypeSubFieldsFilterable.ts
@@ -15,5 +15,7 @@ type FilterableCompositeFieldType = (typeof COMPOSITE_TYPES_FILTERABLE)[number];
export const areCompositeTypeSubFieldsFilterable = (
fieldType: FieldType,
): fieldType is FilterableCompositeFieldType => {
- return COMPOSITE_TYPES_FILTERABLE.includes(fieldType as any);
+ return COMPOSITE_TYPES_FILTERABLE.some(
+ (filterableType) => filterableType === fieldType,
+ );
};
diff --git a/packages/twenty-front/src/modules/object-record/record-filter/utils/isCompositeTypeNonFilterableByAnySubField.ts b/packages/twenty-front/src/modules/object-record/record-filter/utils/isCompositeTypeNonFilterableByAnySubField.ts
index 2dc2e36bf30..90ce972772b 100644
--- a/packages/twenty-front/src/modules/object-record/record-filter/utils/isCompositeTypeNonFilterableByAnySubField.ts
+++ b/packages/twenty-front/src/modules/object-record/record-filter/utils/isCompositeTypeNonFilterableByAnySubField.ts
@@ -11,5 +11,7 @@ type CompositeTypeNonFilterableWithAny =
export const isCompositeTypeNonFilterableByAnySubField = (
fieldType: FieldType,
): fieldType is CompositeTypeNonFilterableWithAny => {
- return COMPOSITE_TYPES_NON_FILTERABLE_WITH_ANY.includes(fieldType as any);
+ return COMPOSITE_TYPES_NON_FILTERABLE_WITH_ANY.some(
+ (compositeType) => compositeType === fieldType,
+ );
};