continue subscriptions and coins
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const admin = require("firebase-admin");
|
||||
const { FieldValue } = require("firebase-admin/firestore");
|
||||
const { onSchedule } = require("firebase-functions/v2/scheduler");
|
||||
const { refList } = require("../index");
|
||||
const firestore = refList.projects.firestore;
|
||||
@@ -71,11 +72,11 @@ exports.snapshotMonthlyTopSongs = onSchedule(
|
||||
},
|
||||
topProjects,
|
||||
totalProjects: topProjects.length,
|
||||
updatedAt: admin.firestore.FieldValue.serverTimestamp(),
|
||||
updatedAt: FieldValue.serverTimestamp(),
|
||||
};
|
||||
|
||||
if (!existingSnapshot.exists) {
|
||||
payload.createdAt = admin.firestore.FieldValue.serverTimestamp();
|
||||
payload.createdAt = FieldValue.serverTimestamp();
|
||||
}
|
||||
|
||||
await docRef.set(payload, { merge: true });
|
||||
|
||||
Reference in New Issue
Block a user