feat: Preserve past SMS workflow reminders by disabling deletion (#21906)

* Preserve past SMS workflow reminders by disabling deletion

* Restored code to delete SMS reminder worflows that fallback to EMAIL

---------

Co-authored-by: Kartik Saini <41051387+kart1ka@users.noreply.github.com>
This commit is contained in:
Dhairyashil Shinde
2025-06-24 12:01:08 +02:00
committed by GitHub
co-authored by Kartik Saini
parent b35eb77edb
commit cb96a56960
@@ -29,25 +29,6 @@ export async function handler(req: NextRequest) {
return NextResponse.json({ message: "Not authenticated" }, { status: 401 });
}
//delete all scheduled sms reminders where scheduled date is past current date
await prisma.workflowReminder.deleteMany({
where: {
OR: [
{
method: WorkflowMethods.SMS,
scheduledDate: {
lte: dayjs().toISOString(),
},
},
{
retryCount: {
gt: 1,
},
},
],
},
});
//find all unscheduled SMS reminders
const unscheduledReminders = (await prisma.workflowReminder.findMany({
where: {