import listQuerier from "~/lib/server/dbHelpers/listQuerier"; export default cachedEventHandler(async (ev) => { const id = parseInt(getRouterParam(ev, "id")!); let s = await listQuerier({ author: { $in: [id] } }, ev.context, ev); const t = s.stories.map((a) => a.toObject()); return { stories: t, total: t.length, }; });