From 87b61b5c549032ab974917cb4bc79873b0c65b1f Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 22 Sep 2021 09:29:51 +0100 Subject: [PATCH] added user created at timestamp --- .../builder/portal/manage/users/_components/AddUserModal.svelte | 2 +- packages/worker/src/api/controllers/global/users.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte index be5d6db746..25a69af1c8 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte @@ -26,7 +26,7 @@ notifications.error(res.message) } else { notifications.success(res.message) - analytics.captureEvent(Events.USER.INVITE) + analytics.captureEvent(Events.USER.INVITE, { type: selected }) } } diff --git a/packages/worker/src/api/controllers/global/users.js b/packages/worker/src/api/controllers/global/users.js index 8f754e2922..ac92f3902c 100644 --- a/packages/worker/src/api/controllers/global/users.js +++ b/packages/worker/src/api/controllers/global/users.js @@ -63,6 +63,7 @@ async function saveUser(user, tenantId, hashPassword = true) { _id = _id || generateGlobalUserID() user = { + createdAt: Date.now(), ...dbUser, ...user, _id, @@ -138,6 +139,7 @@ exports.adminUser = async ctx => { const user = { email: email, password: password, + createdAt: Date.now(), roles: {}, builder: { global: true,