fix(api): update user stories endpoint
it now takes into account the new return type for `listQuerier`
This commit is contained in:
parent
43f16b026d
commit
96a0d36bef
@ -2,8 +2,8 @@ import listQuerier from "~/lib/server/dbHelpers/listQuerier";
|
|||||||
|
|
||||||
export default cachedEventHandler(async (ev) => {
|
export default cachedEventHandler(async (ev) => {
|
||||||
const id = parseInt(getRouterParam(ev, "id")!);
|
const id = parseInt(getRouterParam(ev, "id")!);
|
||||||
let s = await listQuerier({ author: { $in: [id] } }, ev.context);
|
let s = await listQuerier({ author: { $in: [id] } }, ev.context, ev);
|
||||||
const t = s.map((a) => a.toObject());
|
const t = s.stories.map((a) => a.toObject());
|
||||||
return {
|
return {
|
||||||
stories: t,
|
stories: t,
|
||||||
total: t.length,
|
total: t.length,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user