(userId: string)
| 649 | } |
| 650 | |
| 651 | async getUserPoints(userId: string): Promise<number> { |
| 652 | const result = await query<{ total: string }>( |
| 653 | `SELECT COALESCE(SUM(points), 0) as total FROM community_points WHERE workos_user_id = $1`, |
| 654 | [userId] |
| 655 | ); |
| 656 | return parseInt(result.rows[0]?.total || '0', 10); |
| 657 | } |
| 658 | |
| 659 | async getUserBadges(userId: string): Promise<Badge[]> { |
| 660 | const result = await query<Badge & { awarded_at: string }>( |
no outgoing calls
no test coverage detected