diff --git a/packages/server/src/api/controllers/workflow/blockDefinitions.js b/packages/server/src/api/controllers/workflow/blockDefinitions.js index 6b3cdac64d..a0dfe04f2d 100644 --- a/packages/server/src/api/controllers/workflow/blockDefinitions.js +++ b/packages/server/src/api/controllers/workflow/blockDefinitions.js @@ -35,6 +35,9 @@ const ACTION = { password: "password", accessLevelId: "accessLevel", }, + args: { + accessLevelId: "POWER_USER", + }, type: "ACTION", }, SEND_EMAIL: { diff --git a/packages/server/src/workflows/actions.js b/packages/server/src/workflows/actions.js index b20465b24e..27448700f3 100644 --- a/packages/server/src/workflows/actions.js +++ b/packages/server/src/workflows/actions.js @@ -5,13 +5,14 @@ const sgMail = require("@sendgrid/mail") sgMail.setApiKey(process.env.SENDGRID_API_KEY) let BUILTIN_ACTIONS = { - CREATE_USER: async function({ args, instanceId }) { + CREATE_USER: async function({ args, context }) { + const { username, password, accessLevelId } = args const ctx = { - params: { - instanceId, + user: { + instanceId: context.instanceId, }, request: { - body: args.user, + body: { username, password, accessLevelId }, }, }