import { listQuerier } from "@server/dbHelpers";

export default cachedEventHandler(async (ev) => {
	const id = parseInt(getRouterParam(ev, "id")!);
	let s = await listQuerier({ author: { $in: [id] } }, ev.context, ev);
	return {
		stories: s.stories,
		total: s.stories.length,
	};
});
