(userId: string)
| 616 | } |
| 617 | |
| 618 | async getConnectionCount(userId: string): Promise<number> { |
| 619 | const result = await query<{ count: string }>( |
| 620 | `SELECT COUNT(*) as count FROM connections |
| 621 | WHERE (requester_user_id = $1 OR recipient_user_id = $1) |
| 622 | AND status = 'accepted'`, |
| 623 | [userId] |
| 624 | ); |
| 625 | return parseInt(result.rows[0]?.count || '0', 10); |
| 626 | } |
| 627 | |
| 628 | async getPendingRequestCount(userId: string): Promise<number> { |
| 629 | const result = await query<{ count: string }>( |
no outgoing calls
no test coverage detected