MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / isThereAnAdmin

Method isThereAnAdmin

lib/models/user.ts:9–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8export class UserModel {
9 static async isThereAnAdmin() {
10 const user = (await db.query<User>(
11 sql`SELECT * FROM "bewcloud_users" WHERE ("extra" ->> 'is_admin')::boolean IS TRUE LIMIT 1`,
12 ))[
13 0
14 ];
15
16 return Boolean(user);
17 }
18
19 static async getByEmail(email: string) {
20 const lowercaseEmail = email.toLowerCase().trim();

Callers 5

createMethod · 0.95
getFunction · 0.80
postFunction · 0.80
isSignupAllowedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected