Skip to content
Snippets Groups Projects
Commit be729509 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

fix: compare lowerCase with lowerCase

parent c6fa5748
No related branches found
No related tags found
1 merge request!856REDMINE_ISSUE-23375 | Création de vues pour les types de signalements générées automatiquement dans un schéma métier de la BD PostgreSQL
...@@ -634,10 +634,17 @@ export default { ...@@ -634,10 +634,17 @@ export default {
return true; return true;
}, },
/**
* Ensures the name entered in the form is unique among all custom field names.
* This function prevents duplicate names, including those with only case differences,
* to avoid conflicts during automatic view generation where names are slugified.
*
* @returns {boolean} - Returns true if the name is unique (case insensitive), false otherwise.
*/
checkUniqueName() { checkUniqueName() {
const occurences = this.customForms const occurences = this.customForms
.map((el) => el.name.toLowerCase()) // check with lower case in case of slugificaton for data views generation .map((el) => el.name.toLowerCase())
.filter((el) => el === this.form.name.value); .filter((el) => el === this.form.name.value.toLowerCase());
return occurences.length === 1; return occurences.length === 1;
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment