Closed qnreck closed 6 years ago
The Meteor SimpleSchema package is no longer maintained other than critical fixes to keep it running with each latest Meteor release. Closing non-critical issues in this repo. Anyone who cares about this may do one or more of the following:
I tried to use "Asynchronous Custom Validation on the Client" with my project, but it always fail for finding my server method on client side
attachmentIds: { type: Array }, 'attachmentIds.$': { type: String, custom: function () { if (Meteor.isClient && this.isSet) { Meteor.call("searchAttachment", { name: 'att1' }, (err, res) => { console.log("RESULT att::", this.value, err, res); // do smth }); } else { return Attachments.find(this.value).count() ? null : 'invalid'; } } }
With above code, result of
Meteor.call('searchAttachment', ....)
always undefined, and thatsearchAttachment
method never run. Put that coded out of IF clause and it will works. I don't know if it is the correct way to use it or not. Please help. Thanks.Meteor: 1.4.4.1