| 390 | } |
| 391 | |
| 392 | private async getUserEvents(userId: string): Promise<{ id: string; title: string; start_time: string }[]> { |
| 393 | const result = await query<{ id: string; title: string; start_time: string }>( |
| 394 | `SELECT e.id, e.title, e.start_time |
| 395 | FROM events e |
| 396 | JOIN event_registrations er ON er.event_id = e.id |
| 397 | WHERE er.workos_user_id = $1 |
| 398 | ORDER BY e.start_time DESC |
| 399 | LIMIT 10`, |
| 400 | [userId] |
| 401 | ); |
| 402 | return result.rows; |
| 403 | } |
| 404 | |
| 405 | async getUserPublishedContent(userId: string): Promise<PersonPerspective[]> { |
| 406 | const result = await query<PersonPerspective>( |