DB-backed workspace + LangGraph agent

This commit is contained in:
Ruslan Bakiev
2026-02-18 13:56:35 +07:00
parent a8db021597
commit efa0b79c4c
36 changed files with 2125 additions and 468 deletions

View File

@@ -0,0 +1,27 @@
import { prisma } from "../utils/prisma";
import { getAuthContext } from "../utils/auth";
export default defineEventHandler(async (event) => {
const auth = await getAuthContext(event);
const items = await prisma.feedCard.findMany({
where: { teamId: auth.teamId },
include: { contact: { select: { name: true } } },
orderBy: { happenedAt: "desc" },
take: 200,
});
return {
items: items.map((c) => ({
id: c.id,
at: c.happenedAt.toISOString(),
contact: c.contact?.name ?? "",
text: c.text,
proposal: c.proposalJson as any,
decision:
c.decision === "ACCEPTED" ? "accepted" : c.decision === "REJECTED" ? "rejected" : ("pending" as const),
decisionNote: c.decisionNote ?? undefined,
})),
};
});