meteor / meteor/validated-method
Method with no parameters will error
Open
enhancement
- Dominant language
- JavaScript
- Stars
- 193
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
So as per the Meteor guide, if you use `mdg:validated-method` to create a method that takes no parameters, you still must provide a validator, like so:
``` js
validate: new SimpleSchema({}).validator()
```
But there is an issue then if you then call that method with no parameters at all. e.g. calling
``` js
Collection.methods.methodName.call()
```
will error. As the validator, expects an object as the first parameter. Obviously just changing this to:
``` js
Collection.methods.methodName.call({})
```
fixes the issue, but it's a little awkward.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.