import { webhooksCacheTags } from '@admin/actions/webhooks/types' import db from '@admin/db' import { webhooks } from '@admin/db/schema' import { count } from 'drizzle-orm' import { cacheLife, cacheTag } from 'next/cache' export async function countWebhooks(): Promise { 'use cache' cacheLife('max') cacheTag(webhooksCacheTags.endpoints) const [row] = await db.select({ count: count() }).from(webhooks) return Number(row?.count ?? 0) }