Skip to content
Snippets Groups Projects
Commit c8be3836 authored by PASQUIER-TROIANO AZZO's avatar PASQUIER-TROIANO AZZO
Browse files

:twisted_rightwards_arrows: merge fix : bug has been fixed

Merge branch 'fix/89-questioncount-is-inferior-to-question-index-bug' into 'develop'
parents 8d044f94 ae3c96ac
Branches
2 merge requests!96fix : bug has been fixed,!95V4.0
Pipeline #325572 passed with stages
in 1 minute and 32 seconds
......@@ -27,22 +27,16 @@ export class RunRepositoryOnDb implements RunRepository {
}
async getRunsByUser(userId: number) {
return this.prisma.run.findMany({
where: {
quizUserId: userId,
},
include: {
quiz: {
select: {
category: true,
difficulty: true,
name: true,
questionCount: true,
description: true,
},
},
},
});
const runs = await this.prisma.$queryRaw`
SELECT r.*
FROM Run r
INNER JOIN Quiz q ON r.quizId = q.id
WHERE r.quizUserId = ${userId}
AND r.questionIndex < q.questionCount;
`;
console.log(runs);
return runs;
}
async getQuestion(runId: string) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment