API Support: Manage Booking Questions and responses (#253)

Works with https://github.com/calcom/cal.com/pull/8115
pull/9078/head
Hariom Balhara 2023-04-18 19:17:29 +05:30 committed by GitHub
parent 9654677664
commit 0d1ad23c57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,8 @@ const schemaBookingEditParams = z
title: z.string().optional(),
startTime: iso8601.optional(),
endTime: iso8601.optional(),
// Not supporting responses in edit as that might require re-triggering emails
// responses
})
.strict();
@ -61,4 +63,5 @@ export const schemaBookingReadPublic = Booking.extend({
user: true,
metadata: true,
status: true,
responses: true,
});

View File

@ -1,7 +1,7 @@
import { z } from "zod";
import { _EventTypeModel as EventType, _HostModel } from "@calcom/prisma/zod";
import { customInputSchema } from "@calcom/prisma/zod-utils";
import { customInputSchema, eventTypeBookingFields } from "@calcom/prisma/zod-utils";
import { Frequency } from "~/lib/types";
@ -65,6 +65,7 @@ const schemaEventTypeCreateParams = z
recurringEvent: recurringEventInputSchema.optional(),
seatsPerTimeSlot: z.number().optional(),
seatsShowAttendees: z.boolean().optional(),
bookingFields: eventTypeBookingFields,
})
.strict();
@ -79,6 +80,7 @@ const schemaEventTypeEditParams = z
length: z.number().int().optional(),
seatsPerTimeSlot: z.number().optional(),
seatsShowAttendees: z.boolean().optional(),
bookingFields: eventTypeBookingFields,
})
.strict();
@ -116,6 +118,7 @@ export const schemaEventTypeReadPublic = EventType.pick({
metadata: true,
seatsPerTimeSlot: true,
seatsShowAttendees: true,
bookingFields: true,
}).merge(
z.object({
locations: z