pass collection name as error property

This commit is contained in:
ochicf 2018-06-28 10:26:12 +02:00
parent 8f0af09e78
commit 9c2500cde4

View file

@ -63,7 +63,10 @@ export const validateDocument = (document, collection, context) => {
validationErrors.push({
id: `errors.${error.type}`,
path: error.name,
properties: error,
properties: {
collection: collection._name,
...error,
},
});
});
}
@ -144,7 +147,10 @@ export const validateModifier = (modifier, document, collection, context) => {
validationErrors.push({
id: `errors.${error.type}`,
path: error.name,
properties: error,
properties: {
collection: collection._name,
...error,
},
});
});
}