From 1672250995ea2dee722f26d731084115b99cfcb6 Mon Sep 17 00:00:00 2001 From: Vijay Date: Fri, 20 Dec 2024 10:44:11 +0530 Subject: [PATCH] accept timeZone while createNewUsers... and default TZ --- .../migration.sql | 2 ++ packages/prisma/schema.prisma | 2 +- packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 packages/prisma/migrations/20241219153717_default_value_for_timezone_in_schedule_table/migration.sql diff --git a/packages/prisma/migrations/20241219153717_default_value_for_timezone_in_schedule_table/migration.sql b/packages/prisma/migrations/20241219153717_default_value_for_timezone_in_schedule_table/migration.sql new file mode 100644 index 00000000000000..23c8539a02b273 --- /dev/null +++ b/packages/prisma/migrations/20241219153717_default_value_for_timezone_in_schedule_table/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Schedule" ALTER COLUMN "timeZone" SET DEFAULT 'Europe/London'; diff --git a/packages/prisma/schema.prisma b/packages/prisma/schema.prisma index 68bf38d70427ce..0380d93c1794e5 100644 --- a/packages/prisma/schema.prisma +++ b/packages/prisma/schema.prisma @@ -683,7 +683,7 @@ model Schedule { eventType EventType[] instantMeetingEvents EventType[] @relation("InstantMeetingSchedule") name String - timeZone String? + timeZone String? @default("Europe/London") availability Availability[] Host Host[] diff --git a/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts b/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts index 5f2d87996364fb..a4b1d59e582a52 100644 --- a/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts +++ b/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts @@ -358,6 +358,7 @@ export async function createNewUsersConnectToOrgIfExists({ })), }, }, + ...(timeZone && { timeZone }), }, }, },