Truthy value was impossible on completedOnboarding, either undefined/false (#2243)
This commit is contained in:
parent
7716b4c15f
commit
77266535e5
1 changed files with 13 additions and 11 deletions
|
@ -23,13 +23,14 @@ async function createUserAndEventType(opts: {
|
|||
}
|
||||
>;
|
||||
}) {
|
||||
const userData: Prisma.UserCreateArgs["data"] = {
|
||||
const userData = {
|
||||
...opts.user,
|
||||
password: await hashPassword(opts.user.password),
|
||||
emailVerified: new Date(),
|
||||
completedOnboarding: opts.user.completedOnboarding ?? true,
|
||||
locale: "en",
|
||||
schedules: opts.user.completedOnboarding
|
||||
schedules:
|
||||
opts.user.completedOnboarding ?? true
|
||||
? {
|
||||
create: {
|
||||
name: "Working Hours",
|
||||
|
@ -42,6 +43,7 @@ async function createUserAndEventType(opts: {
|
|||
}
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const user = await prisma.user.upsert({
|
||||
where: { email: opts.user.email },
|
||||
update: userData,
|
||||
|
|
Loading…
Reference in a new issue