Skip to content
Snippets Groups Projects
Commit 046f0c6b authored by michael.minelli's avatar michael.minelli
Browse files

Assignment => Corrige: include members

parent c711b82a
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ import db from '../../DatabaseHelper';
import LazyVal from '../../../shared/helpers/LazyVal';
async function getCorrections(assignment: { name: string }): Promise<Array<Exercise> | undefined> {
async function getCorrections(assignment: { name: string }): Promise<Array<Partial<Exercise>> | undefined> {
try {
return await db.exercise.findMany({
where : {
......@@ -12,8 +12,13 @@ async function getCorrections(assignment: { name: string }): Promise<Array<Exerc
correctionCommit: {
not: Prisma.JsonNull
}
},
include: {
assignment: false,
members : true,
results : false
}
}) as Array<Exercise> ?? undefined;
}) as Array<Partial<Exercise>> ?? undefined;
} catch ( e ) {
return undefined;
}
......@@ -25,7 +30,7 @@ export default Prisma.defineExtension(client => {
assignment: {
corrections: {
compute(assignment) {
return new LazyVal<Array<Exercise> | undefined>(() => {
return new LazyVal<Array<Partial<Exercise>> | undefined>(() => {
return getCorrections(assignment);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment