2023-10-10 21:54:37 -04:00
|
|
|
import listQuerier from "~/lib/server/dbHelpers/listQuerier";
|
|
|
|
|
|
|
|
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);
|
|
|
|
const t = s.stories.map((a) => a.toObject());
|
2023-10-10 21:54:37 -04:00
|
|
|
return {
|
|
|
|
stories: t,
|
|
|
|
total: t.length,
|
|
|
|
};
|
|
|
|
});
|