From cdd7e493abb212419914cc1c5d1b7ff5d963fee4 Mon Sep 17 00:00:00 2001 From: Dylan To Date: Tue, 31 Dec 2024 15:50:01 +0800 Subject: [PATCH] I literally did nothing except add a log --- src/app/api/cron/cycle-memberships/route.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/app/api/cron/cycle-memberships/route.ts b/src/app/api/cron/cycle-memberships/route.ts index 38ba9c957..9f02a5ed8 100644 --- a/src/app/api/cron/cycle-memberships/route.ts +++ b/src/app/api/cron/cycle-memberships/route.ts @@ -21,10 +21,9 @@ export async function GET(request: NextRequest) { await Sentry.withMonitor("cycle-memberships", async () => { // TODO backup with xata cli and put into aws bucket dbRes = await db.select().from(users).where(eq(users.role, "member")) - console.log(dbRes) + console.log(dbRes.length) // const dbRes = await db.update(users).set({ role: null }).where(eq(users.role, "member")).returning() }) - console.log(dbRes) if (!dbRes.length) { return new Response("Internal Server Error", { @@ -32,11 +31,9 @@ export async function GET(request: NextRequest) { }) } - return new Response( - JSON.stringify({ - success: true, - message: `Memberships for ${new Date().getFullYear()} have been cycled.`, - count: dbRes.length, - }), - ) + return Response.json({ + success: true, + message: `Memberships for ${new Date().getFullYear()} have been cycled.`, + count: dbRes.length, + }) }