Fix create user workflow action
This commit is contained in:
parent
9077e89192
commit
3bf0358716
|
@ -35,6 +35,9 @@ const ACTION = {
|
||||||
password: "password",
|
password: "password",
|
||||||
accessLevelId: "accessLevel",
|
accessLevelId: "accessLevel",
|
||||||
},
|
},
|
||||||
|
args: {
|
||||||
|
accessLevelId: "POWER_USER",
|
||||||
|
},
|
||||||
type: "ACTION",
|
type: "ACTION",
|
||||||
},
|
},
|
||||||
SEND_EMAIL: {
|
SEND_EMAIL: {
|
||||||
|
|
|
@ -5,13 +5,14 @@ const sgMail = require("@sendgrid/mail")
|
||||||
sgMail.setApiKey(process.env.SENDGRID_API_KEY)
|
sgMail.setApiKey(process.env.SENDGRID_API_KEY)
|
||||||
|
|
||||||
let BUILTIN_ACTIONS = {
|
let BUILTIN_ACTIONS = {
|
||||||
CREATE_USER: async function({ args, instanceId }) {
|
CREATE_USER: async function({ args, context }) {
|
||||||
|
const { username, password, accessLevelId } = args
|
||||||
const ctx = {
|
const ctx = {
|
||||||
params: {
|
user: {
|
||||||
instanceId,
|
instanceId: context.instanceId,
|
||||||
},
|
},
|
||||||
request: {
|
request: {
|
||||||
body: args.user,
|
body: { username, password, accessLevelId },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue