add accountCreated
This commit is contained in:
parent
9528624f95
commit
928e283b3c
|
@ -106,6 +106,7 @@ export async function createNewUser(input: {
|
|||
password,
|
||||
level: "basic",
|
||||
tests: [],
|
||||
accountCreated: now,
|
||||
lastLogin: now,
|
||||
lastActive: now,
|
||||
userTextOptionsRecord: undefined,
|
||||
|
@ -124,6 +125,7 @@ export async function createNewUser(input: {
|
|||
[input.strategy]: input.profile,
|
||||
level: "basic",
|
||||
tests: [],
|
||||
accountCreated: now,
|
||||
lastLogin: now,
|
||||
lastActive: now,
|
||||
userTextOptionsRecord: undefined,
|
||||
|
@ -146,6 +148,7 @@ export async function createNewUser(input: {
|
|||
lastLogin: now,
|
||||
tests: [],
|
||||
lastActive: now,
|
||||
accountCreated: now,
|
||||
level: "basic",
|
||||
userTextOptionsRecord: undefined,
|
||||
}
|
||||
|
@ -163,6 +166,7 @@ export async function createNewUser(input: {
|
|||
lastLogin: now,
|
||||
tests: [],
|
||||
lastActive: now,
|
||||
accountCreated: now,
|
||||
level: "basic",
|
||||
userTextOptionsRecord: undefined,
|
||||
}
|
||||
|
|
|
@ -151,7 +151,9 @@ const authRouter = (passport: PassportStatic) => {
|
|||
if (!req.user || !req.user.admin) {
|
||||
return res.redirect("/");
|
||||
}
|
||||
const users = await getAllLingdocsUsers();
|
||||
const users = (await getAllLingdocsUsers()).sort((a, b) => (
|
||||
(a.accountCreated || 0) - (b.accountCreated || 0)
|
||||
));
|
||||
res.render("admin", { users });
|
||||
} catch (e) {
|
||||
next(e);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<th scope="col">Email</th>
|
||||
<th scope="col">Providers</th>
|
||||
<th scope="col">Level</th>
|
||||
<th scope="col">Tests</th>
|
||||
<th scope="col">Joined</th>
|
||||
<th shope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -88,6 +88,9 @@
|
|||
<%= users[i].level %>
|
||||
<% } %>
|
||||
</td>
|
||||
<td>
|
||||
<%= users[i].accountCreated %>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-danger" onClick="handleDeleteUser('<%= users[i].userId %>', '<%= users[i].name %>')"><i class="fa fa-trash"></i></button>
|
||||
</td>
|
||||
|
|
|
@ -47,6 +47,7 @@ export type LingdocsUser = {
|
|||
},
|
||||
upgradeToStudentRequest?: "waiting" | "denied",
|
||||
tests: TestResult[],
|
||||
accountCreated?: TimeStamp,
|
||||
lastLogin: TimeStamp,
|
||||
lastActive: TimeStamp,
|
||||
userTextOptionsRecord: undefined | UserTextOptionsRecord,
|
||||
|
|
Loading…
Reference in New Issue