Feat/error boundaries (#2779)
* - Changed to objectNameSingular always defined - Added ErrorCatchAll * - Added mock mode for companies logged out - Added a proper ErrorBoundary component * Removed react-error-boundary * Implemented proper ErrorBoundary * Fixes * Change strategy about mocks --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -10,12 +10,13 @@ export const useRelationFieldPreviewValue = ({
|
||||
}) => {
|
||||
const { findObjectMetadataItemById } = useObjectMetadataItemForSettings();
|
||||
|
||||
// TODO: make this impossible to be undefined
|
||||
const relationObjectMetadataItem = relationObjectMetadataId
|
||||
? findObjectMetadataItemById(relationObjectMetadataId)
|
||||
: undefined;
|
||||
|
||||
const { records: relationObjects } = useFindManyRecords({
|
||||
objectNamePlural: relationObjectMetadataItem?.namePlural,
|
||||
objectNameSingular: relationObjectMetadataItem?.nameSingular ?? '',
|
||||
skip: skip || !relationObjectMetadataItem,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user