Skip to content

Commit

Permalink
I literally did nothing except add a log
Browse files Browse the repository at this point in the history
  • Loading branch information
dct0 committed Dec 31, 2024
1 parent d0205e0 commit cdd7e49
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/app/api/cron/cycle-memberships/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,19 @@ 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", {
status: 500,
})
}

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,
})
}

0 comments on commit cdd7e49

Please sign in to comment.