feat: add waitlist signup count

This commit is contained in:
Maze Winther
2025-06-22 14:25:19 +02:00
parent 6e84dcaffb
commit e84caf3f9f
3 changed files with 52 additions and 8 deletions

View File

@ -0,0 +1,15 @@
import { db } from "@/lib/db";
import { waitlist } from "@/lib/db/schema";
import { sql } from "drizzle-orm";
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;
}
}