Files
jlinc-server/backend/modules/dashboard/account.js
2026-08-20 15:08:32 +00:00

13 lines
390 B
JavaScript

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();
}
}