mirror of
https://github.com/vale981/Vulcan
synced 2025-03-04 17:21:37 -05:00
clean document/data in default mut.
This commit is contained in:
parent
2b1776ff02
commit
922ddc72b0
1 changed files with 6 additions and 0 deletions
|
@ -65,6 +65,9 @@ export const createMutator = async ({
|
|||
// we don't want to modify the original document
|
||||
document = data || document;
|
||||
|
||||
// clean document
|
||||
document = collection.simpleSchema().clean(document);
|
||||
|
||||
const { collectionName, typeName } = collection.options;
|
||||
const schema = collection.simpleSchema()._schema;
|
||||
|
||||
|
@ -241,6 +244,9 @@ export const updateMutator = async ({
|
|||
const { collectionName, typeName } = collection.options;
|
||||
const schema = collection.simpleSchema()._schema;
|
||||
|
||||
// clean data
|
||||
data = collection.simpleSchema().clean(data);
|
||||
|
||||
// OpenCRUD backwards compatibility
|
||||
selector = selector || { _id: documentId };
|
||||
data = data || modifierToData({ $set: set, $unset: unset });
|
||||
|
|
Loading…
Add table
Reference in a new issue