Introduce a RelationPicker component with a RelationPickerScope (#2617)
Refactor mainIdentifier into scope componetn
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { useObjectMainIdentifier } from '@/object-metadata/hooks/useObjectMainIdentifier';
|
||||
import { useObjectMetadataItemForSettings } from '@/object-metadata/hooks/useObjectMetadataItemForSettings';
|
||||
import { useFindManyObjectRecords } from '@/object-record/hooks/useFindManyObjectRecords';
|
||||
|
||||
@ -20,18 +19,7 @@ export const useRelationFieldPreview = ({
|
||||
skip: skipDefaultValue || !relationObjectMetadataItem,
|
||||
});
|
||||
|
||||
const {
|
||||
labelIdentifierFieldPaths,
|
||||
imageIdentifierUrlField,
|
||||
imageIdentifierUrlPrefix,
|
||||
imageIdentifierFormat,
|
||||
} = useObjectMainIdentifier(relationObjectMetadataItem);
|
||||
|
||||
return {
|
||||
defaultValue: relationObjects?.[0],
|
||||
labelIdentifierFieldPaths,
|
||||
imageIdentifierUrlField,
|
||||
imageIdentifierUrlPrefix,
|
||||
imageIdentifierFormat,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user