claude-hindsight 2.0.0

20/20 hindsight for your Claude Code sessions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Project routes: GET /api/projects

use crate::server::dto::ProjectStatsDto;
use crate::server::{error::ApiError, AppState};
use axum::{extract::State, Json};

use super::with_index;

pub async fn list_projects(
    State(_state): State<AppState>,
) -> Result<Json<Vec<ProjectStatsDto>>, ApiError> {
    with_index(|index| {
        index
            .get_all_project_stats()
            .map(|v| v.into_iter().map(ProjectStatsDto::from).collect())
    })
    .await
}