fix: incomplete field list for assigned fields (#2093)

This commit is contained in:
katherinehhh 2023-06-21 18:29:14 +08:00 committed by GitHub
parent dae191691c
commit 1006a66a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,7 @@ export enum AssignedFieldValueType {
export const AssignedField = (props: any) => {
const { t } = useTranslation();
const compile = useCompile();
const collection = useCollection();
const field = useField<Field>();
const fieldSchema = useFieldSchema();
const isDynamicValue =
@ -110,7 +111,7 @@ export const AssignedField = (props: any) => {
const [options, setOptions] = useState<any[]>([]);
const { getField } = useCollection();
const collectionField = getField(fieldSchema.name);
const fields = useCollectionFilterOptions(collectionField?.collectionName);
const fields = useCollectionFilterOptions(collection?.name);
const userFields = useCollectionFilterOptions('users');
const dateTimeFields = ['createdAt', 'datetime', 'time', 'updatedAt'];
useEffect(() => {