diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index bfad38676e..3fcb26912e 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -139,11 +139,13 @@ export const EventSetupTab = ( return true; }); + const defaultValue = locationOptions.find((item) => item.label === "video")?.options; return (
{validLocations.length === 0 && (
{ const { schedulingType, teamId, ...rest } = input; const userId = ctx.user.id; - + const appKeys = await getAppKeysFromSlug("daily-video"); const data: Prisma.EventTypeCreateInput = { ...rest, owner: teamId ? undefined : { connect: { id: userId } }, @@ -413,14 +413,10 @@ export const eventTypesRouter = router({ id: userId, }, }, + ...((typeof rest?.locations === "undefined" || rest.locations?.length === 0) && + typeof appKeys.api_key === "string" && { locations: [{ type: DailyLocationType }] }), }; - const appKeys = await getAppKeysFromSlug("daily-video"); - // Shouldn't override input locations - if (rest.locations?.length === 0 && typeof appKeys.api_key === "string") { - data.locations = [{ type: DailyLocationType }]; - } - if (teamId && schedulingType) { const hasMembership = await ctx.prisma.membership.findFirst({ where: {