11 lines
277 B
TypeScript
11 lines
277 B
TypeScript
import { topics } 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(topics);
|
|
return rows;
|
|
}); |