From 594cc8403e015ac2d115688eb6b1359e98e1134b Mon Sep 17 00:00:00 2001 From: Brent Hoover Date: Tue, 18 Oct 2016 21:45:35 +0800 Subject: [PATCH] Select products not flagged as deleted (#1489) * Selected products not flagged as deleted * Select all products not flagged as deleted * Add nul to second selector --- server/publications/collections/product.js | 4 ++-- server/publications/collections/products.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/publications/collections/product.js b/server/publications/collections/product.js index 3a016cbee91..96e99eb2918 100644 --- a/server/publications/collections/product.js +++ b/server/publications/collections/product.js @@ -22,7 +22,7 @@ Meteor.publish("Product", function (productId) { let selector = {}; selector.isVisible = true; - selector.isDeleted = false; + selector.isDeleted = {$in: [null, false]}; if (Roles.userIsInRole(this.userId, ["owner", "admin", "createProduct"], shop._id)) { @@ -51,7 +51,7 @@ Meteor.publish("Product", function (productId) { // Selector for hih? selector = { isVisible: true, - isDeleted: false, + isDeleted: {$in: [null, false]}, $or: [ { _id: _id }, { diff --git a/server/publications/collections/products.js b/server/publications/collections/products.js index 4cac4813f62..76e7a377736 100644 --- a/server/publications/collections/products.js +++ b/server/publications/collections/products.js @@ -80,7 +80,7 @@ Meteor.publish("Products", function (productScrollLimit = 24, productFilters, so if (shop) { const selector = { - isDeleted: false, + isDeleted: {$in: [null, false]}, ancestors: { $exists: true, $eq: []