소스 검색

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]));