Skip to content

Commit 72584f2

Browse files
committed
updates
1 parent 3746a7a commit 72584f2

4 files changed

Lines changed: 11 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
types: ["opened", "synchronize", "reopened", "edited"]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
format:
1215
name: Run Prettier

src/app/api/cron/cycle-memberships/route.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as Sentry from "@sentry/nextjs"
22
import { format } from "date-fns"
3-
import { and, eq, lte } from "drizzle-orm"
3+
import { lte } from "drizzle-orm"
44
import type { NextRequest } from "next/server"
55
import { Resend } from "resend"
66

@@ -22,14 +22,12 @@ export async function GET(request: NextRequest) {
2222
}
2323

2424
let dbRes: (typeof User.$inferSelect)[] = []
25-
const now = new Date()
26-
const today = new Date(now)
25+
const today = new Date()
2726

2827
await Sentry.withMonitor("cycle-memberships", async () => {
29-
// TODO: backup db and put into aws bucket
3028
dbRes = await db
3129
.update(User)
32-
.set({ role: null, membership_expiry: null, reminder_pending: true })
30+
.set({ role: null, membership_expiry: null })
3331
.where(lte(User.membership_expiry, today))
3432
.returning()
3533
})

src/app/api/cron/prevent-supabase-pausing/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export async function GET(request: NextRequest) {
1414
})
1515
}
1616

17-
let dbHealth
17+
let dbHealth = false
1818
try {
1919
const result = await db.execute<{ healthy: boolean }>(sql`SELECT true as healthy`)
20-
dbHealth = result.rows[0]?.healthy
20+
dbHealth = result.rows[0]?.healthy ?? false
2121
} catch (err) {
22-
dbHealth = false
22+
console.error("Database health check failed", err)
2323
}
2424

2525
return Response.json(

src/components/email-template.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Body, Button, Container, Head, Html, Img, Preview, Section, Text } from
22
import * as React from "react"
33

44
interface MembershipRenewalReminderEmailProps {
5-
firstname?: string
6-
membershipEndDate?: string
5+
firstname: string
6+
membershipEndDate: string
77
websiteLink?: string
88
}
99

@@ -12,12 +12,6 @@ export const MembershipRenewalReminderEmail = ({
1212
membershipEndDate,
1313
websiteLink = "https://codersforcauses.org/join",
1414
}: MembershipRenewalReminderEmailProps) => {
15-
// let year = new Date().getFullYear()
16-
// const month = new Date().getMonth()
17-
// if (month < 6) {
18-
// year -= 1
19-
// }
20-
2115
return (
2216
<Html>
2317
<Head />

0 commit comments

Comments
 (0)