Add persistent history stacks

This commit is contained in:
2026-07-23 21:48:24 +02:00
parent 2d0aa11d9c
commit 1e4dd26bb8
24 changed files with 2294 additions and 15 deletions
@@ -0,0 +1,18 @@
import type { Request, Response } from "express";
import { db } from "../../db/client.js";
import { ProjectHistoryRepository } from "../../db/repositories/project-history.repository.js";
const projectHistoryRepository = new ProjectHistoryRepository(db);
export function getProjectHistory(req: Request, res: Response) {
const { projectId } = req.params;
if (typeof projectId !== "string") {
return res.status(400).json({ error: "Invalid projectId" });
}
const state = projectHistoryRepository.getState(projectId);
if (!state) {
return res.status(404).json({ error: "Project not found" });
}
return res.json(state);
}