refactor: replace timeZone string validation with timeZoneSchema (#20719)
* refactor: replace timeZone string validation with timeZoneSchema - Replace all instances of timeZone: z.string() with timeZoneSchema - Preserve modifiers (.optional(), .default(), .nullish()) where present - Fix VideoApiAdapter to use organizer's timezone value - Remove redundant isSupportedTimeZone import from booking.ts - Add timeZoneSchema import where needed * Update index.ts * fix: conflicts Signed-off-by: Omar López <[email protected]> * Update yarn.lock * Discard changes to yarn.lock * Update booking.ts * Discard changes to packages/platform/types/me.ts * Discard changes to packages/platform/types/me/outputs/me.ts * Discard changes to packages/platform/types/schedules/schedules-2024-04-15/schedules.ts * Discard changes to packages/features/ee/cal-ai-phone/zod-utils.ts --------- Signed-off-by: Omar López <[email protected]>
This commit is contained in:
1 parent
46c6582328
commit
d81b905ad7
10 files changed
+31
-11
No files matched your search
@@ -6,6 +6,7 @@ import { Controller, useForm, useFormContext } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
import { TimezoneSelect } from "@calcom/features/components/timezone-select";
|
||||
import { timeZoneSchema } from "@calcom/lib/dayjs/timeZone.schema";
|
||||
import { emailSchema } from "@calcom/lib/emailSchema";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { MembershipRole } from "@calcom/prisma/enums";
|
||||
@@ -58,7 +59,7 @@ const editSchema = z.object({
|
||||
avatar: z.string(),
|
||||
bio: z.string(),
|
||||
role: z.enum([MembershipRole.MEMBER, MembershipRole.ADMIN, MembershipRole.OWNER]),
|
||||
timeZone: z.string(),
|
||||
timeZone: timeZoneSchema,
|
||||
// schedules: z.array(z.string()),
|
||||
// teams: z.array(z.string()),
|
||||
attributes: z.array(attributeSchema).optional(),
|
||||
|
||||
Reference in new issue
Block a user