Fix create user workflow action

This commit is contained in:
Andrew Kingston 2020-09-10 16:46:58 +01:00
parent 9077e89192
commit 3bf0358716
2 changed files with 8 additions and 4 deletions

View File

@ -35,6 +35,9 @@ const ACTION = {
password: "password",
accessLevelId: "accessLevel",
},
args: {
accessLevelId: "POWER_USER",
},
type: "ACTION",
},
SEND_EMAIL: {

View File

@ -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 },
},
}