* Get the count of published research perspectives from the Editorial working group.
()
| 28 | * Get the count of published research perspectives from the Editorial working group. |
| 29 | */ |
| 30 | async function getResearchArticleCount(): Promise<number> { |
| 31 | const result = await query<{ count: string }>( |
| 32 | `SELECT COUNT(*) as count |
| 33 | FROM perspectives p |
| 34 | JOIN working_groups wg ON p.working_group_id = wg.id |
| 35 | WHERE p.status = 'published' |
| 36 | AND wg.slug = 'editorial' |
| 37 | AND (p.source_type IS NULL OR p.source_type NOT IN ('rss', 'email'))` |
| 38 | ); |
| 39 | return parseInt(result.rows[0]?.count || "0", 10); |
| 40 | } |
| 41 | |
| 42 | // Article type for API responses |
| 43 | interface LatestArticle { |
no outgoing calls
no test coverage detected