This commit is contained in:
Diamond Lewis
2018-06-16 11:25:49 -05:00
committed by Arthur Cinader
parent 00252cbeff
commit 0e93306867
2 changed files with 5 additions and 3 deletions

View File

@@ -3684,8 +3684,8 @@ describe('Parse.Query testing', () => {
});
});
it("includeAll", (done) => {
const child1 = new TestObject({ foo: 'bar', name: 'al' });
it('includeAll', (done) => {
const child1 = new TestObject({ foo: 'bar', name: 'ac' });
const child2 = new TestObject({ foo: 'baz', name: 'flo' });
const child3 = new TestObject({ foo: 'bad', name: 'mo' });
const parent = new Container({ child1, child2, child3 });
@@ -3702,7 +3702,7 @@ describe('Parse.Query testing', () => {
equal(result.child1.foo, 'bar');
equal(result.child2.foo, 'baz');
equal(result.child3.foo, 'bad');
equal(result.child1.name, 'al');
equal(result.child1.name, 'ac');
equal(result.child2.name, 'flo');
equal(result.child3.name, 'mo');
done();

View File

@@ -558,6 +558,7 @@ RestQuery.prototype.runCount = function() {
});
};
// Augments this.response with all pointers on an object
RestQuery.prototype.handleIncludeAll = function() {
if (!this.includeAll) {
return;
@@ -575,6 +576,7 @@ RestQuery.prototype.handleIncludeAll = function() {
}
// Add fields to include, keys, remove dups
this.include = [...new Set([...this.include, ...includeFields])];
// if this.keys not set, then all keys are already included
if (this.keys) {
this.keys = [...new Set([...this.keys, ...keyFields])];
}