From feaf4cd80a2af7fb813bd79fd9b7173d5dcdbced Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Thu, 14 Sep 2023 14:21:30 +0800 Subject: [PATCH] fix: filterable undefined (#2646) --- .../schema-component/antd/filter/Filter.Action.Designer.tsx | 2 +- .../src/schema-component/antd/filter/useFilterActionProps.ts | 4 ++-- .../client/src/schema-settings/LinkageRules/Variables.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/filter/Filter.Action.Designer.tsx b/packages/core/client/src/schema-component/antd/filter/Filter.Action.Designer.tsx index 5d471f59f..b37620ee2 100644 --- a/packages/core/client/src/schema-component/antd/filter/Filter.Action.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/filter/Filter.Action.Designer.tsx @@ -14,7 +14,7 @@ export const useFilterableFields = (collectionName: string) => { return false; } const fieldInterface = getInterface(field.interface); - if (!fieldInterface.filterable) { + if (!fieldInterface?.filterable) { return false; } return true; diff --git a/packages/core/client/src/schema-component/antd/filter/useFilterActionProps.ts b/packages/core/client/src/schema-component/antd/filter/useFilterActionProps.ts index 4a350c0b4..585134778 100644 --- a/packages/core/client/src/schema-component/antd/filter/useFilterActionProps.ts +++ b/packages/core/client/src/schema-component/antd/filter/useFilterActionProps.ts @@ -36,7 +36,7 @@ export const useGetFilterFieldOptions = () => { return; } const fieldInterface = getInterface(field.interface); - if (!fieldInterface.filterable) { + if (!fieldInterface?.filterable) { return; } const { nested, children, operators } = fieldInterface.filterable; @@ -93,7 +93,7 @@ export const useFilterFieldOptions = (fields) => { return; } const fieldInterface = getInterface(field.interface); - if (!fieldInterface.filterable) { + if (!fieldInterface?.filterable) { return; } const { nested, children, operators } = fieldInterface.filterable; diff --git a/packages/core/client/src/schema-settings/LinkageRules/Variables.tsx b/packages/core/client/src/schema-settings/LinkageRules/Variables.tsx index d095814e2..0ea7b5d62 100644 --- a/packages/core/client/src/schema-settings/LinkageRules/Variables.tsx +++ b/packages/core/client/src/schema-settings/LinkageRules/Variables.tsx @@ -39,7 +39,7 @@ const useVariableTypes = (currentCollection, excludes = []) => { return; } const fieldInterface = getInterface(field.interface); - if (!fieldInterface.filterable) { + if (!fieldInterface?.filterable) { return; } const { nested, children } = fieldInterface.filterable;