12 lines
278 B
TypeScript
12 lines
278 B
TypeScript
import { agents } from "~~/db/schema";
|
|
import { protectRoute } from "~~/server/utils/auth";
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
await protectRoute(event);
|
|
|
|
const db = useDrizzle();
|
|
|
|
const rows = await db.select().from(agents);
|
|
return rows;
|
|
});
|