add checks to the existence of object variables
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
dc6c8f924d
commit
594cee12f3
|
@ -20,13 +20,17 @@ module.exports = Self => {
|
||||||
message: 'The supplier name must be unique'
|
message: 'The supplier name must be unique'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.city) {
|
||||||
Self.validatesPresenceOf('city', {
|
Self.validatesPresenceOf('city', {
|
||||||
message: 'City cannot be empty'
|
message: 'City cannot be empty'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.nif) {
|
||||||
Self.validatesPresenceOf('nif', {
|
Self.validatesPresenceOf('nif', {
|
||||||
message: 'The nif cannot be empty'
|
message: 'The nif cannot be empty'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Self.validatesUniquenessOf('nif', {
|
Self.validatesUniquenessOf('nif', {
|
||||||
message: 'TIN must be unique'
|
message: 'TIN must be unique'
|
||||||
|
|
Loading…
Reference in New Issue