next/server/api/sidebar/index.get.ts

7 lines
185 B
TypeScript
Raw Normal View History

import { SidebarItem } from "~/models/sidebarEntry";
export default cachedEventHandler(async (ev) => {
const si = await SidebarItem.find({});
return si.map((a) => a.toObject());
});