2023-12-20 17:23:31 -05:00
|
|
|
import { listQuerier } from "@server/dbHelpers";
|
2023-10-10 21:54:37 -04:00
|
|
|
|
|
|
|
export default cachedEventHandler(async (ev) => {
|
|
|
|
const id = parseInt(getRouterParam(ev, "id")!);
|
2023-12-06 21:52:04 -05:00
|
|
|
let s = await listQuerier({ author: { $in: [id] } }, ev.context, ev);
|
2023-10-10 21:54:37 -04:00
|
|
|
return {
|
2023-12-11 21:29:46 -05:00
|
|
|
stories: s.stories,
|
|
|
|
total: s.stories.length,
|
2023-10-10 21:54:37 -04:00
|
|
|
};
|
|
|
|
});
|