DB-backed workspace + LangGraph agent
This commit is contained in:
22
Frontend/server/api/pins.get.ts
Normal file
22
Frontend/server/api/pins.get.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { prisma } from "../utils/prisma";
|
||||
import { getAuthContext } from "../utils/auth";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const auth = await getAuthContext(event);
|
||||
|
||||
const items = await prisma.contactPin.findMany({
|
||||
where: { teamId: auth.teamId },
|
||||
include: { contact: { select: { name: true } } },
|
||||
orderBy: { updatedAt: "desc" },
|
||||
take: 500,
|
||||
});
|
||||
|
||||
return {
|
||||
items: items.map((p) => ({
|
||||
id: p.id,
|
||||
contact: p.contact.name,
|
||||
text: p.text,
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user