continue scaffolding and refine the basic foundation

This commit is contained in:
Zoe
2026-01-13 19:56:24 +00:00
parent 0877cc10bd
commit 8c28946703
37 changed files with 1431 additions and 509 deletions
+4 -1
View File
@@ -1,11 +1,14 @@
import { agents } from "~~/db/schema";
import { protectRoute } from "~~/server/utils/auth";
import { eq } from "drizzle-orm";
export default defineEventHandler(async (event) => {
await protectRoute(event);
const db = useDrizzle();
const userId = event.context.user.id;
const rows = await db.select().from(agents);
// Only return agents for the authenticated user
const rows = await db.select().from(agents).where(eq(agents.userId, userId));
return rows;
});