Untitled
unknown
plain_text
2 years ago
864 B
7
Indexable
const updatePaymentCheckTime = async (updatableDomains) => {
try {
// Read the existing domains data
const domains = await controllers.readDomainsFile(filePath);
// Update paymentCheckedAt for the specified domains
const updatedDomains = domains.map(domain => {
if (updatableDomains.includes(domain.domain)) {
return {
...domain,
paymentCheckedAt: todayDateFormatted(),
};
}
return domain;
});
// Write the updated data back to the file
await controllers.writeDomainsFile(filePath, updatedDomains);
console.log('Payment check time updated successfully.');
} catch (error) {
console.error('Error updating payment check time:', error.message);
}
};Editor is loading...
Leave a Comment