Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
477 B
1
Indexable
Never
const updatePaymentCheckTime = async (updatableDomain) => {
  if (!updatableDomain || !updatableDomain.domain) {
    return;
  }

  const domains = await controllers.readDomainsFile(filePath);

  const updatedDomains = domains.map(item =>
    item.domain === updatableDomain.domain
      ? { ...item, paymentCheckedAt: todayDateFormatted() }
      : item
  );

  await controllers.writeDomainsFile(filePath, updatedDomains);

  console.log(updatedDomains);
};
Leave a Comment