Autoform method-update and satisfying audit-argument-checks


#1

Hello, i’m using the last version of autoform with audit-argument-checks and i removed the package insecure from myproject because i only want to use Methods.

Anyway, i’m using a quickForm with the type “method-update” which call my Method updateEnseigne.
The problem is that i can’t manage to satisfy audit-argument-checks without writing check(doc, Match.Any)

// The quickForm inside enseigne.html
<div class="modal-body">
    {{> quickForm collection="Enseignes" doc=this id="updateEnseigneForm" type="method-update" meteormethod="updateEnseigne"}}
</div>
// my Method inside methods.js
updateEnseigne(doc) {
    Schemas.Enseignes.validate(doc.modifier, { modifier: true });
    check(doc._id, String);
    check(doc, Match.Any); // <-- I'm forced to use this line or i get the Did not check() all arguments error

    if (!this.userId) {
        throw Meteor.Error('unauthorized');
    }

    Enseignes.update({_id: doc._id}, doc.modifier);
},

Is there a different way to validate the argument received inside the update Method ?
The argument received having this structure:

{
  _id: 'docId',
  modifier: {
    $set: {
      field1: 'value1',
      field2: 'value1',
      etc...
    }
  }
}

Thanks you