Merge pull request #14045 from Budibase/fix/allow-case-sensitive-prohibited

Frontend - allow prohibited columns, case sensitive
This commit is contained in:
Michael Drury 2024-06-28 13:29:16 +01:00 committed by GitHub
commit 605a2107be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 5 deletions

View File

@ -495,11 +495,7 @@
newError.name = `Column name cannot start with an underscore.` newError.name = `Column name cannot start with an underscore.`
} else if (fieldInfo.name && !fieldInfo.name.match(ValidColumnNameRegex)) { } else if (fieldInfo.name && !fieldInfo.name.match(ValidColumnNameRegex)) {
newError.name = `Illegal character; must be alpha-numeric.` newError.name = `Illegal character; must be alpha-numeric.`
} else if ( } else if (prohibited.some(name => fieldInfo?.name === name)) {
prohibited.some(
name => fieldInfo?.name?.toLowerCase() === name.toLowerCase()
)
) {
newError.name = `${prohibited.join( newError.name = `${prohibited.join(
", " ", "
)} are not allowed as column names - case insensitive.` )} are not allowed as column names - case insensitive.`