Validator on autoform method-update
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, mongodb
Research direction
Start by reproducing the autoform method-update call with Areas.methods.update and Schemas.Areas.validator(), then inspect how the validation object is passed to ValidatedMethod. Compare the generated modifier with the validation error and verify the expected behavior using the existing issue example.
Written by the indexing model from the issue text.
Description
Hi, i'm using autoform to generate an update form
{{#with area}}
{{#autoForm
collection="Areas"
id="updateAreasForm"
type="method-update"
meteormethod="Areas.methods.update"
doc=this
class="form-horizontal"
}}
{{> afQuickField name='nome' label-class="col-sm-3" input-col-class="col-sm-9"}}
{{> afQuickField name='tipo' label-class="col-sm-3" input-col-class="col-sm-9"}}
{{#unless afFieldValueIs name='tipo' value=1}}
{{> afQuickField name='paiId' label-class="col-sm-3" input-col-class="col-sm-9"}}
{{/unless}}
{{> afQuickField name='ativo' label-class="col-sm-3" input-col-class="col-sm-9"}}
{{> submit texto="Editar"}}
{{/autoForm}}
{{/with}}
Here's the definition of the method:
Areas.methods.update = new ValidatedMethod({
name: 'Areas.methods.update',
validate: Schemas.Areas.validator(),
run(modifier, _id) {
console.log(modifier, _id);
return Areas.update({_id: _id}, modifier);
}
});
I'm getting this error:
Exception while simulating the effect of invoking 'Areas.methods.update' Error: When the validation object contains mongo operators, you must set the modifier option to true(…) Error: When the validation object contains mongo operators, you must set the modifier option to true
at doValidation1 (http://localhost:3000/packages/aldeed_simple-schema.js?3d6ebc811c555e8ab1ad73b249a995dc641334ed:2278:11)
at doValidation (http://localhost:3000/packages/aldeed_simple-schema.js?3d6ebc811c555e8ab1ad73b249a995dc641334ed:2910:10)
at SimpleSchemaValidationContext.simpleSchemaValidationContextValidate [as validate] (http://localhost:3000/packages/aldeed_simple-schema.js?3d6ebc811c555e8ab1ad73b249a995dc641334ed:2945:21)
at SimpleSchema.validate (http://localhost:3000/packages/aldeed_simple-schema.js?3d6ebc811c555e8ab1ad73b249a995dc641334ed:2132:35)
at null.<anonymous> (http://localhost:3000/packages/aldeed_simple-schema.js?3d6ebc811c555e8ab1ad73b249a995dc641334ed:2154:10)
at ValidatedMethod._execute (http://localhost:3000/packages/mdg_validated-method.js?a862c6e60ea48391f9f16ddbf7d1748fa9231a3b:118:64)
at ValidatedMethod.connection.methods._connection$methods.(anonymous function) (http://localhost:3000/packages/mdg_validated-method.js?a862c6e60ea48391f9f16ddbf7d1748fa9231a3b:71:21)
at http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3911:25
at _.extend.withValue (http://localhost:3000/packages/meteor.js?9730f4ff059088b3f7f14c0672d155218a1802d4:971:17)
at _.extend.apply (http://localhost:3000/packages/ddp-client.js?250b63e6c919c5383a0511ee4efbf42bb70a650f:3902:54)
Do you guys have any idea about what is happening? Thanks
- Dominant language
- JavaScript
- Stars
- 193
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from meteor/validated-method
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
meteor/validated-method#95 · 1 comment ·
-
Async validation Open
Difficulty 4/5 3-5 days Newbie friendliness 38/100
meteor/validated-method#94 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
meteor/validated-method#89 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
meteor/validated-method#87 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
meteor/validated-method#81 · 1 comment ·
All issues in meteor/validated-method
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·