forked from jappel/leistungsbilanz-ts
Add project command API
This commit is contained in:
parent
1e4dd26bb8
commit
e4c7cf06e9
19 changed files with 781 additions and 21 deletions
|
|
@ -1,8 +1,5 @@
|
|||
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);
|
||||
import { projectHistoryStore } from "../composition/project-command-stores.js";
|
||||
|
||||
export function getProjectHistory(req: Request, res: Response) {
|
||||
const { projectId } = req.params;
|
||||
|
|
@ -10,7 +7,7 @@ export function getProjectHistory(req: Request, res: Response) {
|
|||
return res.status(400).json({ error: "Invalid projectId" });
|
||||
}
|
||||
|
||||
const state = projectHistoryRepository.getState(projectId);
|
||||
const state = projectHistoryStore.getState(projectId);
|
||||
if (!state) {
|
||||
return res.status(404).json({ error: "Project not found" });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue