feat: GET /users (search/list) and GET /users/count

This commit is contained in:
2026-05-14 15:34:37 +02:00
parent a2cc4fba21
commit eb7dbb0aee
4 changed files with 62 additions and 1 deletions

View File

@@ -176,6 +176,13 @@ impl UserRepository for PgUserRepository {
following_count: r.following_count,
}).collect())
}
async fn count(&self) -> Result<i64, DomainError> {
sqlx::query_scalar::<_, i64>("SELECT COUNT(*) FROM users WHERE local = true")
.fetch_one(&self.pool)
.await
.map_err(|e| DomainError::Internal(e.to_string()))
}
}
#[cfg(test)]