We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
idValidation
1 parent 613ccb8 commit 5e7ee98Copy full SHA for 5e7ee98
packages/api-headless-cms/src/content/plugins/models/ContentModel/idValidation.ts
@@ -5,4 +5,7 @@ export default async (value: string) => {
5
if (!value.charAt(0).match(/[a-zA-Z]/)) {
6
throw new Error(`Provided ID ${value} is not valid - must not start with a number.`);
7
}
8
+ if (value.trim().toLowerCase() === "id") {
9
+ throw new Error(`Provided ID ${value} is not valid - "id" is an auto-generated field.`);
10
+ }
11
};
0 commit comments