stacker.news/worker/reminder.js
ekzyis e29c6b4842
Refactor reminder push notifications (#2026)
* Refactor reminder push notifications

items should always exist and if not, we can just immediately fail imo

* Use same text for reminders in /notifications
2025-03-26 10:59:27 -05:00

11 lines
321 B
JavaScript

import { notifyReminder } from '@/lib/webPush'
export async function remindUser ({ data: { itemId, userId }, models }) {
try {
const item = await models.item.findUnique({ where: { id: itemId } })
await notifyReminder({ userId, item })
} catch (err) {
console.error('failed to send reminder:', err)
}
}