better
This commit is contained in:
parent
0a9e5e274f
commit
e0508c8883
|
@ -306,7 +306,7 @@ const authRouter = (passport: PassportStatic) => {
|
|||
function getTestCompletionSummary(users: T.LingdocsUser[]) {
|
||||
const tests: { id: string, passes: number }[] = [];
|
||||
users.forEach(u => (
|
||||
u.tests.forEach(({id}) => {
|
||||
Array.from(new Set(u.tests.map(x => x.id))).forEach(id => {
|
||||
const ti = tests.findIndex(x => x.id === id);
|
||||
if (ti > -1) tests[ti].passes++;
|
||||
else tests.push({ id, passes: 1 });
|
||||
|
|
Loading…
Reference in New Issue