diff --git a/server/api/user/[id]/stories.get.ts b/server/api/user/[id]/stories.get.ts index 24dd936..bfe578d 100644 --- a/server/api/user/[id]/stories.get.ts +++ b/server/api/user/[id]/stories.get.ts @@ -2,8 +2,8 @@ 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); - const t = s.map((a) => a.toObject()); + let s = await listQuerier({ author: { $in: [id] } }, ev.context, ev); + const t = s.stories.map((a) => a.toObject()); return { stories: t, total: t.length,