feat: add host validation for team event types (#24170)
* feat: add host validation for team event types * refactor: remove hosts validator in favor of documentation-based validation approach * fix: remove HostsOrAssignAllValidator from event type update inputs * docs: improve clarity of hosts and assignAllTeamMembers field descriptions in event type inputs
This commit is contained in:
+3
-2
@@ -19,6 +19,7 @@ import {
|
||||
ArrayUnique,
|
||||
} from "class-validator";
|
||||
|
||||
|
||||
import { SchedulingType } from "@calcom/platform-enums";
|
||||
|
||||
import { BookerLayouts_2024_06_14 } from "./booker-layouts.input";
|
||||
@@ -560,14 +561,14 @@ export class CreateTeamEventTypeInput_2024_06_14 extends BaseCreateEventTypeInpu
|
||||
@DocsPropertyOptional({
|
||||
type: [Host],
|
||||
description:
|
||||
"Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users.",
|
||||
"Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users. Provide either hosts or assignAllTeamMembers but not both",
|
||||
})
|
||||
hosts?: Host[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional({
|
||||
description: "If true, all current and future team members will be assigned to this event type",
|
||||
description: "If true, all current and future team members will be assigned to this event type. Provide either assignAllTeamMembers or hosts but not both",
|
||||
})
|
||||
assignAllTeamMembers?: boolean;
|
||||
|
||||
|
||||
+5
-3
@@ -455,14 +455,16 @@ export class UpdateTeamEventTypeInput_2024_06_14 extends BaseUpdateEventTypeInpu
|
||||
@Type(() => Host)
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional({ type: [Host] })
|
||||
@DocsPropertyOptional({ type: [Host],
|
||||
description:
|
||||
"Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users. Provide either hosts or assignAllTeamMembers but not both",
|
||||
})
|
||||
hosts?: Host[];
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
@DocsPropertyOptional({
|
||||
description: "If true, all current and future team members will be assigned to this event type",
|
||||
description: "If true, all current and future team members will be assigned to this event type. Provide either assignAllTeamMembers or hosts but not both",
|
||||
})
|
||||
assignAllTeamMembers?: boolean;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user