Simplification vérification

This commit is contained in:
Jean-Christophe Engel 2023-10-30 14:43:45 +01:00
parent 90d954a255
commit b46ce09d33
1 changed files with 2 additions and 4 deletions

View File

@ -32,10 +32,8 @@
{{#form on="save"}}
{{* Vérifier s'il existe déjà une catégorie avec le même nom *}}
{{#load type="category"}}
{{if $name|trim|tolower == $_POST.name|trim|tolower }}
{{#load type="category" where="lower($$.name) = :name" :name=$_POST.name|trim|tolower}}
{{:error message="Impossible d'ajouter la catégorie « %s » car elle existe déjà !"|args:$name|trim}}
{{/if}}
{{/load}}
{{:assign key=""|uuid}}