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:
1 parent
1d309a6f09
commit
3942df369d
5 files changed
+54
-4
No files matched your search
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user