fix(beforeSave): Skip Sanitizing Database results (#7003)

* fix(beforeSave): Skip Sanitizing Database results

* fix test
This commit is contained in:
Diamond Lewis
2020-11-11 19:39:25 -06:00
committed by GitHub
parent 568c285369
commit a4c84c09be
2 changed files with 16 additions and 1 deletions

View File

@@ -1479,6 +1479,21 @@ describe('Cloud Code', () => {
});
});
it('beforeSave should not sanitize database', async done => {
let count = 0;
Parse.Cloud.beforeSave('CloudIncrementNested', () => {
count += 1;
});
const obj = new Parse.Object('CloudIncrementNested');
obj.set('objectField', { number: 5 });
await obj.save();
obj.increment('objectField.number', 10);
await obj.save();
count === 2 ? done() : fail();
});
/**
* Verifies that an afterSave hook throwing an exception
* will not prevent a successful save response from being returned

View File

@@ -235,7 +235,7 @@ RestWrite.prototype.runBeforeSaveTrigger = function () {
this.query,
this.data,
this.runOptions,
false,
true,
true
);
} else {