ソースを参照

Bug fix: getting orders was not returning the expected results for an empty list of ingredients.

Lee Morgan 5 年 前
コミット
3bba6cb83b
1 ファイル変更1 行追加1 行削除
  1. 1 1
      controllers/orderData.js

+ 1 - 1
controllers/orderData.js

@@ -29,7 +29,7 @@ module.exports = {
         let match = {};
         let objectifiedIngredients = [];
         if(req.body.ingredients.length === 0){
-            match = {$exists: true};
+            match = {$ne: false};
         }else{  
             for(let i = 0; i < req.body.ingredients.length; i++){
                 objectifiedIngredients.push(new ObjectId(req.body.ingredients[i]));