chore: open disableGuests for event-types apiv2 (#15001)
* chore: open disableGuests for eventtypes apiv2 * fixup! chore: open disableGuests for eventtypes apiv2 * fixup! fixup! chore: open disableGuests for eventtypes apiv2 * chore: add disableGuests to create handler
This commit is contained in:
@@ -131,6 +131,7 @@ describe("Event types Endpoints", () => {
|
||||
description: "A description of the test event type.",
|
||||
length: 60,
|
||||
hidden: false,
|
||||
disableGuests: true,
|
||||
locations: [
|
||||
{
|
||||
type: "Online",
|
||||
@@ -148,6 +149,7 @@ describe("Event types Endpoints", () => {
|
||||
const responseBody: ApiSuccessResponse<EventType> = response.body;
|
||||
expect(responseBody.data).toHaveProperty("id");
|
||||
expect(responseBody.data.title).toEqual(body.title);
|
||||
expect(responseBody.data.disableGuests).toEqual(body.disableGuests);
|
||||
eventType = responseBody.data;
|
||||
});
|
||||
});
|
||||
@@ -157,14 +159,19 @@ describe("Event types Endpoints", () => {
|
||||
|
||||
const body: UpdateEventTypeInput = {
|
||||
title: newTitle,
|
||||
disableGuests: false,
|
||||
};
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.patch(`/api/v2/event-types/${eventType.id}`)
|
||||
.send(body)
|
||||
.expect(200)
|
||||
.then(async () => {
|
||||
.then(async (response) => {
|
||||
const responseBody: ApiSuccessResponse<EventType> = response.body;
|
||||
expect(responseBody.data.title).toEqual(newTitle);
|
||||
expect(responseBody.data.disableGuests).toEqual(body.disableGuests);
|
||||
eventType.title = newTitle;
|
||||
eventType.disableGuests = responseBody.data.disableGuests ?? false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ export class CreateEventTypeInput {
|
||||
@IsArray()
|
||||
locations?: EventTypeLocation[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
disableGuests?: boolean;
|
||||
|
||||
// @ApiHideProperty()
|
||||
// @IsOptional()
|
||||
// @IsNumber()
|
||||
|
||||
@@ -322,9 +322,9 @@ export class UpdateEventTypeInput {
|
||||
// @IsOptional()
|
||||
// recurringEvent?: RecurringEvent;
|
||||
|
||||
// @IsBoolean()
|
||||
// @IsOptional()
|
||||
// disableGuests?: boolean;
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
disableGuests?: boolean;
|
||||
|
||||
// @IsBoolean()
|
||||
// @IsOptional()
|
||||
|
||||
@@ -404,6 +404,38 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v2/oauth-clients/{clientId}/managed-users": {
|
||||
"get": {
|
||||
"operationId": "OAuthClientsController_getOAuthClientManagedUsersById",
|
||||
"summary": "",
|
||||
"description": "⚠️ First, this endpoint requires `Cookie: next-auth.session-token=eyJhbGciOiJ` header. Log into Cal web app using owner of organization that was created after visiting `/settings/organizations/new`, refresh swagger docs, and the cookie will be added to requests automatically to pass the NextAuthGuard.\nSecond, make sure that the logged in user has organizationId set to pass the OrganizationRolesGuard guard.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "clientId",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/GetManagedUsersOutput"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"OAuth - development only"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v2/oauth/{clientId}/authorize": {
|
||||
"post": {
|
||||
"operationId": "OAuthFlowController_authorize",
|
||||
@@ -2067,6 +2099,9 @@
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/EventTypeLocation"
|
||||
}
|
||||
},
|
||||
"disableGuests": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -2749,6 +2784,9 @@
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/EventTypeLocation"
|
||||
}
|
||||
},
|
||||
"disableGuests": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ export const createEventTypeInput = z.object({
|
||||
schedulingType: z.nativeEnum(SchedulingType).nullish(),
|
||||
locations: imports.eventTypeLocations,
|
||||
metadata: imports.EventTypeMetaDataSchema.optional(),
|
||||
disableGuests: z.boolean().optional(),
|
||||
})
|
||||
.partial({ hidden: true, locations: true })
|
||||
.refine((data) => (data.teamId ? data.teamId && data.schedulingType : true), {
|
||||
|
||||
Reference in New Issue
Block a user