Enabling Async Validation in package mdg:validated-method

@rjdavid coming back to your question regarding stage 1 and stage 2:

There is already 2.0.0-rc.0 out there which should cover stage 1. However, in order to proceed to stage 2 it would be great to have a few people that are currently exactly facing the use case of stage 1 to use this rc and test for themselves. If this is fine to go, we can immediately move on.

1 Like

I decided not to be dependent on async validate(). The large majority of my validations relies on checking the existence and access rights a user has on a passed document id. So I have extended SimpleSchema to allow me to annotate foreign keys, in terms of what collection they point to and what permissions are required for access. I now have a general function that is called at the start of every method (not in validate()) that performs the checks and, as a bonus, returns the document content for foreign keys passed as they are inevitably needed by the method itself (so saving on DB calls). So my validate() functions are now only structure checking.

I do intend on posting full details about my migration method, tasks and experience by end April which might be useful for others to see.

1 Like