(userId: string)
| 5 | |
| 6 | export 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: '' }; |