diff --git a/middleware/VegetableTypes.js b/middleware/VegetableTypes.js index 05835c8..9698bbf 100644 --- a/middleware/VegetableTypes.js +++ b/middleware/VegetableTypes.js @@ -31,6 +31,7 @@ class VegetableTypes { let k = 0 for (k = 0; k < vegetables.length; k += 1) { if (type.Vegetables[j].name < vegetables[k]) { + console.log('Break at:', k) break } } @@ -41,7 +42,7 @@ class VegetableTypes { res.push(type) } - callback(null, { count: items.count, rows: res }) + callback(null, { count: res.length, rows: res }) }) .catch((e) => { console.log('ERR:', e)