tsdexter
11/17/2018, 12:52 AMRole
requires a list of [User!]!
and a single `Customer`… When I signup a user I want to create the new Customer
, it’s first User
and an admin Role
for that Customer
and User
- how would I do this?
const user = await ctx.db.createUser({
firstname: firstname || undefined,
lastname: lastname || undefined,
email,
password: hashedPassword,
emailConfirmToken,
emailConfirmed: false,
inviteAccepted: true,
customer: {
create: {
name: customerName
}
},
role: {
create: {
name: "Admin",
permissions: {
connect: {
allow: "SUDO"
}
}
}
}
});
this creates the role on the user, but I also want the Role
to be associated to the Customer
created above it…? Do I have to create the Role
in a separate request and then just connect it in the customer
and role
fields?Harshit
11/17/2018, 2:25 AMtsdexter
11/19/2018, 2:16 PMcreating
and connecting
the Role
to the User
but I also want this role connected to the Company
that is also created and connected to this userHarshit
11/19/2018, 2:18 PM