Started adding async calls for upgrading to Meteor 3.0. Numerous other fixes.

This commit is contained in:
2025-07-02 11:18:09 -07:00
parent e1216741d6
commit 2e99ad007c
32 changed files with 549 additions and 373 deletions

View File

@@ -1,12 +1,12 @@
Meteor.methods({
"checkDuplicateSales": function() {
"checkDuplicateSales": async function() {
try {
let sales = Sales.find({}).fetch();
let sales = await Sales.find({}).fetchAsync();
let duplicateCount = 0;
for(let i = 0; i < sales.length; i++) {
let next = missingData[i];
let count = Sales.find({date: next.date, measureId: next.measureId, productId: next.productId, venueId: next.venueId, price: next.price, amount: next.amount}).count();
let count = await Sales.countDocuments({date: next.date, measureId: next.measureId, productId: next.productId, venueId: next.venueId, price: next.price, amount: next.amount});
if(count > 1) {
console.log("This sale has a duplicate:");