addition of new dashboard

This commit is contained in:
2026-08-20 15:08:32 +00:00
parent 0622018d95
commit bf59249ed7
161 changed files with 13170 additions and 119 deletions

View File

@@ -0,0 +1,12 @@
import { getPool } from "../../db/index.js";
// Legacy `auth` table only; the user-managed api_key store is counted separately.
export async function countApiKeys(userId) {
const client = await getPool();
try {
const r = await client.query(`SELECT COUNT(*)::int AS n FROM auth WHERE user_id = $1`, [userId]);
return r.rows[0].n;
} finally {
await client.release();
}
}