I base on Meteor, Simple Schema, Uniform
(React)
// Method
Meteor.methods({
existName(name) {
return name == 'Rabbit'
},
})
--------------
// Custom Msg
SimpleSchema.setDefaultMessages({
messages: {
en: {
nameExist: 'Name is exist!',
},
},
})
// Schema
name: {
type: String,
async custom() {
const result = await Meteor.call('existValue', this.value)
if (result) {
return 'nameExist'
}
},
},
-----------------
// Uniform-Material
....... Code Here ........
But don’t work, please help me
And then I tried to validate on client, It work fine
// Schema
name: {
type: String,
custom() {
if (this.value == 'Rabbit') {
return 'nameExist'
}
},
},