Skip to content

Commit 708bd8f

Browse files
committed
[push] Cohorts deletion fix
1 parent 3478b9b commit 708bd8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/push/api/parts/endpoints.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,9 @@ function catchy(f) {
11701170
api.onCohortDelete = (_id, app_id, ack) => {
11711171
return new Promise((resolve, reject) => {
11721172
if (ack) {
1173-
common.dbPromise('messages', 'update', {auto: true, $bitsAllSet: {'result.status': N.Status.Scheduled}, autoCohorts: _id}, {$bit: {'result.status': {and: ~N.Status.Scheduled}}}).then(() => resolve(ack), reject);
1173+
common.dbPromise('messages', 'update', {auto: true, 'result.status': {$bitsAllSet: N.Status.Scheduled}, autoCohorts: _id}, {$bit: {'result.status': {and: ~N.Status.Scheduled}}}).then(() => resolve(ack), reject);
11741174
} else {
1175-
common.db.collection('messages').count({auto: true, $bitsAllSet: {'result.status': N.Status.Scheduled}, autoCohorts: _id}, (err, count) => {
1175+
common.db.collection('messages').count({auto: true, 'result.status': {$bitsAllSet: N.Status.Scheduled}, autoCohorts: _id}, (err, count) => {
11761176
if (err) {
11771177
log.e('[auto] Error while loading messages: %j', err);
11781178
reject(err);

0 commit comments

Comments
 (0)