Add "type" to reserved keywords in object metadata validation (#8548)

This PR adds "type" to the reserved keywords list in
validate-object-metadata-input.util.ts. This prevents users from
creating objects with "type" as a key, which has caused issues in the
past .
issue solved #8543 

1.Updated the RESERVED_KEYWORDS array to include "type"

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
shubham yadav
2024-11-18 19:40:49 +05:30
committed by GitHub
parent d8626b1304
commit 8b8b9fe55b

View File

@@ -40,10 +40,15 @@ const reservedKeywords = [
'fullNames',
'address',
'addresses',
'type',
'types',
'object',
'objects',
'index',
'relation',
'relations',
];
const METADATA_NAME_VALID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;
export const validateObjectMetadataInputOrThrow = <
T extends UpdateObjectPayload | CreateObjectInput,
>(