addition of new dashboard
This commit is contained in:
1 parent
0622018d95
commit
bf59249ed7
161 files changed
+13170
-119
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user