From 0e837899a423aaf413f80e78fef66332426a5f00 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 7 Dec 2020 20:46:37 +0000 Subject: [PATCH] code review --- packages/server/src/api/controllers/user.js | 3 +-- packages/server/src/api/routes/tests/couchTestUtils.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/user.js b/packages/server/src/api/controllers/user.js index 83408d80f9..5cdfb68d8f 100644 --- a/packages/server/src/api/controllers/user.js +++ b/packages/server/src/api/controllers/user.js @@ -20,7 +20,7 @@ exports.fetch = async function(ctx) { exports.create = async function(ctx) { const db = new CouchDB(ctx.user.appId) - const { email, password, name, accessLevelId, permissions } = ctx.request.body + const { email, password, accessLevelId, permissions } = ctx.request.body if (!email || !password) { ctx.throw(400, "email and Password Required.") @@ -34,7 +34,6 @@ exports.create = async function(ctx) { _id: generateUserID(email), email, password: await bcrypt.hash(password), - name, type: "user", accessLevelId, permissions: permissions || [BUILTIN_PERMISSION_NAMES.POWER], diff --git a/packages/server/src/api/routes/tests/couchTestUtils.js b/packages/server/src/api/routes/tests/couchTestUtils.js index 783eca8920..75f2728c5e 100644 --- a/packages/server/src/api/routes/tests/couchTestUtils.js +++ b/packages/server/src/api/routes/tests/couchTestUtils.js @@ -118,7 +118,7 @@ exports.clearApplications = async request => { exports.createUser = async ( request, appId, - email = "babs", + email = "babs@babs.com", password = "babs_password" ) => { const res = await request