Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

use updatedAt

Steven Tey3db320cd6db4
diff --git a/apps/web/app/(ee)/api/cron/cleanup/rejected-applications/route.ts b/apps/web/app/(ee)/api/cron/cleanup/rejected-applications/route.ts
index 808c3a97c5..a3d9ffa0bf 100644
--- a/apps/web/app/(ee)/api/cron/cleanup/rejected-applications/route.ts
+++ b/apps/web/app/(ee)/api/cron/cleanup/rejected-applications/route.ts
@@ -8,7 +8,7 @@ export const dynamic = "force-dynamic";
// This route is used to remove rejected programEnrollments from the database after 30 days so partners can re-apply
// Runs once every day at 02:00:00 AM UTC (0 2 * * *)
-// GET /api/cron/cleanup/rejected-applications
+// POST /api/cron/cleanup/rejected-applications
export async function POST(req: Request) {
try {
const rawBody = await req.text();
@@ -23,7 +23,7 @@ export async function POST(req: Request) {
await prisma.programEnrollment.deleteMany({
where: {
status: "rejected",
- createdAt: {
+ updatedAt: {
lt: new Date(Date.now() - 1000 * 60 * 60 * 24 * 30),
},
},