fix: getFrontpage query
This commit is contained in:
parent
b258afe16d
commit
34cfa31fe9
|
@ -3,14 +3,13 @@ import { Question } from "@prisma/client";
|
||||||
import { measureTime } from "./utils/measureTime";
|
import { measureTime } from "./utils/measureTime";
|
||||||
|
|
||||||
export async function getFrontpage(): Promise<Question[]> {
|
export async function getFrontpage(): Promise<Question[]> {
|
||||||
const questions = await prisma.question.findMany({
|
const questions = (
|
||||||
where: {
|
await prisma.frontpageId.findMany({
|
||||||
onFrontpage: {
|
include: {
|
||||||
isNot: null,
|
question: true,
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
});
|
).map((f) => f.question);
|
||||||
console.log(questions.length);
|
|
||||||
return questions;
|
return questions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user