diff --git a/src/backend/frontpage.ts b/src/backend/frontpage.ts index 3d41e93..e50ab0f 100644 --- a/src/backend/frontpage.ts +++ b/src/backend/frontpage.ts @@ -3,14 +3,13 @@ import { Question } from "@prisma/client"; import { measureTime } from "./utils/measureTime"; export async function getFrontpage(): Promise { - const questions = await prisma.question.findMany({ - where: { - onFrontpage: { - isNot: null, + const questions = ( + await prisma.frontpageId.findMany({ + include: { + question: true, }, - }, - }); - console.log(questions.length); + }) + ).map((f) => f.question); return questions; }