use normal validate() to throw an error

This commit is contained in:
SachaG 2017-05-07 22:15:52 +09:00
parent bda9feab98
commit 5054dcc900

View file

@ -119,7 +119,7 @@ export const editMutation = ({ collection, documentId, set, unset, currentUser,
if (validate) {
// validate modifiers
collection.simpleSchema().newContext().validate({$set: set, $unset: unset}, { modifier: true });
collection.simpleSchema().validate({$set: set, $unset: unset}, { modifier: true });
// check that the current user has permission to edit each field
const modifiedProperties = _.keys(set).concat(_.keys(unset));