* 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 <[email protected]>
This commit is contained in:
1 parent
16fba702fb
commit
bf659c0b16
11 files changed
+267
-217
No files matched your search
@@ -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