Pārlūkot izejas kodu

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

Lee Morgan 5 gadi atpakaļ
vecāks
revīzija
3bba6cb83b
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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]));