summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/waitlist.ts
blob: 22b15b78a3f424119ed10fcbc096b5ee03632478 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { db, sql, waitlist } from "@opencut/db";

export async function getWaitlistCount() {
  try {
    const result = await db
      .select({ count: sql<number>`count(*)` })
      .from(waitlist);
    return result[0]?.count || 0;
  } catch (error) {
    console.error("Failed to fetch waitlist count:", error);
    return 0;
  }
}