* Fixed #1015 - Teams user registration is broken * Type fixes for avilability form in onboarding * Re adds missing strings * Updates user availability in one query Tested and working correctly * Fixes seeder and tests Co-authored-by: Omar López <zomars@me.com>
This commit is contained in:
co-authored by
Omar López
parent
16fba702fb
commit
bf659c0b16
@@ -3,6 +3,7 @@ import dayjs from "dayjs";
|
||||
import { uuid } from "short-uuid";
|
||||
|
||||
import { hashPassword } from "../lib/auth";
|
||||
import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "../lib/availability";
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
@@ -26,6 +27,11 @@ async function createUserAndEventType(opts: {
|
||||
password: await hashPassword(opts.user.password),
|
||||
emailVerified: new Date(),
|
||||
completedOnboarding: opts.user.completedOnboarding ?? true,
|
||||
availability: {
|
||||
createMany: {
|
||||
data: getAvailabilityFromSchedule(DEFAULT_SCHEDULE),
|
||||
},
|
||||
},
|
||||
};
|
||||
const user = await prisma.user.upsert({
|
||||
where: { email: opts.user.email },
|
||||
|
||||
Reference in New Issue
Block a user