From 4fda7475f4f224332fc44fc8f76245466ebcb8fc Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Thu, 8 Sep 2022 11:36:36 +0400 Subject: [PATCH] up --- account/src/middleware/setup-passport.ts | 1 - account/src/routers/auth-router.ts | 6 +++++- account/views/admin.ejs | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/account/src/middleware/setup-passport.ts b/account/src/middleware/setup-passport.ts index d3e4224..4452844 100644 --- a/account/src/middleware/setup-passport.ts +++ b/account/src/middleware/setup-passport.ts @@ -17,7 +17,6 @@ import { } from "../lib/user-utils"; import env from "../lib/env-vars"; import * as T from "../../../website/src/types/account-types"; -import { getTimestamp } from "../lib/time-utils"; export const outsideProviders: ("github" | "google" | "twitter")[] = ["github", "google", "twitter"]; diff --git a/account/src/routers/auth-router.ts b/account/src/routers/auth-router.ts index df7a05d..5d373e8 100644 --- a/account/src/routers/auth-router.ts +++ b/account/src/routers/auth-router.ts @@ -154,7 +154,11 @@ const authRouter = (passport: PassportStatic) => { const users = (await getAllLingdocsUsers()).sort((a, b) => ( (a.accountCreated || 0) - (b.accountCreated || 0) )); - res.render("admin", { users }); + const tests = new Set(); + users.forEach(u => u.tests.forEach(t => ( + tests.add(t.id) + ))); + res.render("admin", { users, tests: Array.from(tests) }); } catch (e) { next(e); } diff --git a/account/views/admin.ejs b/account/views/admin.ejs index ff57ab1..cbdb144 100644 --- a/account/views/admin.ejs +++ b/account/views/admin.ejs @@ -100,6 +100,12 @@ <% } %> +
+
Tests Completed
+ <% for(var i=0; i < tests.length; i++) { %> +
<%= tests[i] %>
+ <% } %> +
\ No newline at end of file