Fix/object record and metadata naming (#2763)
* Fixed object-record and object-metadata naming * Fix post merge --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { useFindManyObjectRecords } from '@/object-record/hooks/useFindManyObjectRecords';
|
||||
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
import { assertNotNull } from '~/utils/assert';
|
||||
|
||||
export const useFieldPreviewValue = ({
|
||||
@ -10,12 +10,12 @@ export const useFieldPreviewValue = ({
|
||||
objectNamePlural: string;
|
||||
skip?: boolean;
|
||||
}) => {
|
||||
const { objects } = useFindManyObjectRecords({
|
||||
const { records } = useFindManyRecords({
|
||||
objectNamePlural,
|
||||
skip,
|
||||
});
|
||||
|
||||
const firstRecordWithValue = objects.find(
|
||||
const firstRecordWithValue = records.find(
|
||||
(record) => assertNotNull(record[fieldName]) && record[fieldName] !== '',
|
||||
);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useObjectMetadataItemForSettings } from '@/object-metadata/hooks/useObjectMetadataItemForSettings';
|
||||
import { useFindManyObjectRecords } from '@/object-record/hooks/useFindManyObjectRecords';
|
||||
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
|
||||
export const useRelationFieldPreviewValue = ({
|
||||
relationObjectMetadataId,
|
||||
@ -14,7 +14,7 @@ export const useRelationFieldPreviewValue = ({
|
||||
? findObjectMetadataItemById(relationObjectMetadataId)
|
||||
: undefined;
|
||||
|
||||
const { objects: relationObjects } = useFindManyObjectRecords({
|
||||
const { records: relationObjects } = useFindManyRecords({
|
||||
objectNamePlural: relationObjectMetadataItem?.namePlural,
|
||||
skip: skip || !relationObjectMetadataItem,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user