11 lines
287 B
TypeScript
11 lines
287 B
TypeScript
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,
|
|
};
|
|
});
|