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

Method getByUserId

lib/models/dashboard.ts:7–14  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

5
6export class DashboardModel {
7 static async getByUserId(userId: string) {
8 const dashboard =
9 (await db.query<Dashboard>(sql`SELECT * FROM "bewcloud_dashboards" WHERE "user_id" = $1 LIMIT 1`, [
10 userId,
11 ]))[0];
12
13 return dashboard;
14 }
15
16 static async create(userId: string) {
17 const data: Dashboard['data'] = { links: [], notes: '' };

Callers 3

getFunction · 0.80
postFunction · 0.80
postFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected