Prevent remote object updates (#4804)
Backend: Adding a new util function that throw an error if the objectMetadata is remote Frontend: hiding the save button when remote Also renaming `useObjectMetadataItemForSettings` since this hook is used in other places than settings and is not in the settings repo. Name can definitely be challenged! --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
import { ObjectMetadataInterface } from 'src/engine/metadata-modules/field-metadata/interfaces/object-metadata.interface';
|
||||
|
||||
export const assertMutationNotOnRemoteObject = (
|
||||
objectMetadataItem: ObjectMetadataInterface,
|
||||
) => {
|
||||
if (objectMetadataItem.isRemote) {
|
||||
throw new Error('Remote objects are read-only');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user