From c6f7f115b59f159fe430e9f3df8b5645e29c9b5d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 19 May 2021 15:55:00 +0100 Subject: [PATCH] Fixing issues with the user table within the apps. --- packages/auth/src/db/utils.js | 2 +- packages/auth/src/utils.js | 3 ++ .../DataTable/modals/CreateEditUser.svelte | 14 ------ packages/server/src/api/controllers/row.js | 49 ++++++++++--------- packages/server/src/api/controllers/user.js | 13 +++-- .../server/src/utilities/workerRequests.js | 35 ++++++++----- .../worker/src/api/controllers/admin/users.js | 11 +++-- 7 files changed, 70 insertions(+), 57 deletions(-) diff --git a/packages/auth/src/db/utils.js b/packages/auth/src/db/utils.js index e33b2b719f..93217277e7 100644 --- a/packages/auth/src/db/utils.js +++ b/packages/auth/src/db/utils.js @@ -190,7 +190,7 @@ exports.getAllApps = async ({ dev, all } = {}) => { } else { return apps.map(app => ({ ...app, - status: isDevApp(app) ? "development" : "published" + status: isDevApp(app) ? "development" : "published", })) } } diff --git a/packages/auth/src/utils.js b/packages/auth/src/utils.js index a0ba0d25b5..278ad07174 100644 --- a/packages/auth/src/utils.js +++ b/packages/auth/src/utils.js @@ -112,6 +112,9 @@ exports.isClient = ctx => { * @return {Promise} */ exports.getGlobalUserByEmail = async email => { + if (email == null) { + throw "Must supply an email address to view" + } const db = getDB(StaticDatabases.GLOBAL.name) try { let users = ( diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte index bf1030dc2c..b18e26fde4 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte @@ -85,10 +85,6 @@ bind:value={row.email} readonly={!creating} /> - role.name} getOptionValue={role => role._id} /> -