From d79af627ec334b893c2216d83e167cb12d71301a Mon Sep 17 00:00:00 2001 From: Rairn <958414905@qq.com> Date: Mon, 24 Apr 2023 15:21:31 +0800 Subject: [PATCH] fix: avoid errors --- .../schema-component/antd/record-picker/InputRecordPicker.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/record-picker/InputRecordPicker.tsx b/packages/core/client/src/schema-component/antd/record-picker/InputRecordPicker.tsx index f2636a0fd..a028107ec 100644 --- a/packages/core/client/src/schema-component/antd/record-picker/InputRecordPicker.tsx +++ b/packages/core/client/src/schema-component/antd/record-picker/InputRecordPicker.tsx @@ -159,7 +159,7 @@ export const InputRecordPicker: React.FC = (props: IRecordPickerProps) => { multiple={multiple} quickUpload={quickUpload} selectFile={selectFile} - action={`${collectionField.target}:create`} + action={`${collectionField?.target}:create`} onSelect={handleSelect} onRemove={handleRemove} onChange={(changed) => { @@ -237,7 +237,7 @@ const Drawer: React.FunctionComponent<{ options, }) => { const getFilter = () => { - const targetKey = collectionField.targetKey || 'id'; + const targetKey = collectionField?.targetKey || 'id'; const list = options.map((option) => option[targetKey]).filter(Boolean); const filter = list.length ? { $and: [{ [`${targetKey}.$ne`]: list }] } : {}; return filter;