mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-10 18:33:55 +08:00
fix: avoid errors
This commit is contained in:
parent
fbe73d1e80
commit
d79af627ec
@ -159,7 +159,7 @@ export const InputRecordPicker: React.FC<any> = (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;
|
||||
|
Loading…
Reference in New Issue
Block a user