conditionals if name already exists

This commit is contained in:
jorgebl 2021-03-04 21:30:56 +01:00
parent 5ebd70a8f0
commit 4cc3fc90c5
3 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,9 @@
module.exports = Self => {
Self.validatesPresenceOf('name', {
message: 'Name cannot be blank'
});
Self.validatesUniquenessOf('id', {
message: 'This name already exist.'
});
};

View File

@ -0,0 +1,9 @@
module.exports = Self => {
Self.validatesPresenceOf('name', {
message: 'Name cannot be blank'
});
Self.validatesUniquenessOf('id', {
message: 'This name already exist.'
});
};

View File

@ -9,7 +9,6 @@
<vn-autocomplete
label="Genus"
ng-model="$ctrl.botanical.genusFk"
initial-data="$ctrl.getBotanicalData"
url="Genera"
show-field="name"
value-field="id">