From 4b54edf02b1cd89eed3b3bf410b2c4158682b8f7 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 21 Sep 2020 15:05:24 +0100 Subject: [PATCH] Fixing a problem detected by a test case. --- packages/server/src/api/controllers/user.js | 2 +- packages/server/src/workflows/steps/createUser.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/user.js b/packages/server/src/api/controllers/user.js index 22cf2d2a3c..3933e4f790 100644 --- a/packages/server/src/api/controllers/user.js +++ b/packages/server/src/api/controllers/user.js @@ -56,9 +56,9 @@ exports.create = async function(ctx) { ctx.status = 200 ctx.message = "User created successfully." + ctx.userId = response._id ctx.body = { _rev: response.rev, - _id: user._id, username, name, } diff --git a/packages/server/src/workflows/steps/createUser.js b/packages/server/src/workflows/steps/createUser.js index 8633c861ee..de2b6ca1ad 100644 --- a/packages/server/src/workflows/steps/createUser.js +++ b/packages/server/src/workflows/steps/createUser.js @@ -71,7 +71,8 @@ module.exports.run = async function({ inputs, instanceId }) { await userController.create(ctx) return { response: ctx.body, - id: ctx.body._id, + // internal property not returned through the API + id: ctx.userId, revision: ctx.body._rev, success: ctx.status === 200, }