summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/waitlist.ts
blob: dacf2615b82b7834d27f74cbc4f327d4516f749b (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;
	}
}