Skip to content

Instantly share code, notes, and snippets.

@BoDonkey
Created March 30, 2023 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoDonkey/21cc930b3f657326558247e1c6ab45f1 to your computer and use it in GitHub Desktop.
Save BoDonkey/21cc930b3f657326558247e1c6ab45f1 to your computer and use it in GitHub Desktop.
Adds testing for a forbidden schema name of "type"- code gets inserted after line 181 of `/piece-type/index.js`
const badFieldName = Object.keys(self.fields).indexOf('type') !== -1;
if (badFieldName) {
throw new Error('@apostrophecms/piece-type field property name cannot be "type"');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment