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

@@ -11,8 +11,8 @@
Meteor.methods({
// Cleans up all Date objects that don't have a time component. Removes any time component.
"enhanceSalesDateFields": function() {
let sales = Sales.find({}).fetch();
"enhanceSalesDateFields": async function() {
let sales = await Sales.find({}).fetchAsync();
for(let i = 0; i < sales.length; i++) {
let dateString = sales[i].date.toString();
@@ -25,7 +25,7 @@ Meteor.methods({
}
// Save to the database.
Sales.update(sales[i]._id, {$set: {"timestamp": timestamp.getTime(), weekOfYear}}, {bypassCollection2: true}, function(err, id) {
await Sales.updateAsync(sales[i]._id, {$set: {"timestamp": timestamp.getTime(), weekOfYear}}, {bypassCollection2: true}, function(err, id) {
if(err) console.log(err);
});
}