diff --git a/lib/server/listQuerier.ts b/lib/server/listQuerier.ts index 44f0259..210a6cd 100644 --- a/lib/server/listQuerier.ts +++ b/lib/server/listQuerier.ts @@ -2,7 +2,7 @@ import { Band } from "~/models/band" import { Challenge } from "~/models/challenges/gen" import { Story } from "~/models/stories" -export default async function(query, context, limit?, sort?) { +export default async function(query, context, limit?: number, sort?) { query["chapters.hidden"] = false if(context.currentUser) { if(!query.author) query.author = {} @@ -19,5 +19,5 @@ export default async function(query, context, limit?, sort?) { .populate({path: "challenge", model: Challenge}).populate('author', 'username _id') .limit(limit || Infinity) .exec(); - return stories + return stories.filter(a => a.author != null) } \ No newline at end of file