fix: getFrontpage query

This commit is contained in:
Vyacheslav Matyukhin 2022-04-23 00:18:53 +04:00
parent b258afe16d
commit 34cfa31fe9
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -3,14 +3,13 @@ import { Question } from "@prisma/client";
import { measureTime } from "./utils/measureTime";
export async function getFrontpage(): Promise<Question[]> {
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;
}