Skip to content

Commit 066ac35

Browse files
committed
Fix for Installations _PushStatus test
1 parent 8eae6a1 commit 066ac35

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

spec/PushController.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ describe('PushController', () => {
357357
})
358358
});
359359

360-
it_exclude_dbs(['postgres'])('should support full RESTQuery for increment', (done) => {
360+
it('should support full RESTQuery for increment', (done) => {
361361
var payload = {data: {
362362
alert: "Hello World!",
363363
badge: 'Increment',
@@ -392,7 +392,7 @@ describe('PushController', () => {
392392
pushController.sendPush(payload, where, config, auth).then((result) => {
393393
done();
394394
}).catch((err) => {
395-
fail('should not fail');
395+
jfail(err);
396396
done();
397397
});
398398
});

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -724,16 +724,15 @@ export class PostgresStorageAdapter {
724724
}
725725
});
726726
}
727+
// Return value not currently well specified.
728+
findOneAndUpdate(className, schema, query, update) {
729+
debug('findOneAndUpdate', className, query, update);
730+
return this.updateObjectsByQuery(className, schema, query, update).then((val) => val[0]);
731+
}
727732

728733
// Apply the update to all objects that match the given Parse Query.
729734
updateObjectsByQuery(className, schema, query, update) {
730735
debug('updateObjectsByQuery', className, query, update);
731-
return this.findOneAndUpdate(className, schema, query, update);
732-
}
733-
734-
// Return value not currently well specified.
735-
findOneAndUpdate(className, schema, query, update) {
736-
debug('findOneAndUpdate', className, query, update);
737736
let conditionPatterns = [];
738737
let updatePatterns = [];
739738
let values = [className]
@@ -859,8 +858,7 @@ export class PostgresStorageAdapter {
859858

860859
let qs = `UPDATE $1:name SET ${updatePatterns.join(',')} WHERE ${where.pattern} RETURNING *`;
861860
debug('update: ', qs, values);
862-
return this._client.any(qs, values)
863-
.then(val => val[0]); // TODO: This is unsafe, verification is needed, or a different query method;
861+
return this._client.any(qs, values); // TODO: This is unsafe, verification is needed, or a different query method;
864862
}
865863

866864
// Hopefully, we can get rid of this. It's only used for config and hooks.

0 commit comments

Comments
 (0)