Set start and endTime to iso8601 (#198)

pull/9078/head
Alex van Andel 2022-10-20 18:26:43 +01:00 committed by GitHub
parent ecd20d63c9
commit 1f9be423ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 12 deletions

View File

@ -1,7 +1,7 @@
import { z } from "zod";
import { _BookingModel as Booking, _AttendeeModel, _UserModel } from "@calcom/prisma/zod";
import { extendedBookingCreateBody } from "@calcom/prisma/zod-utils";
import { extendedBookingCreateBody, iso8601 } from "@calcom/prisma/zod-utils";
import { schemaQueryUserId } from "./shared/queryUserId";
@ -20,28 +20,32 @@ export const schemaBookingCreateBodyParams = extendedBookingCreateBody.merge(sch
const schemaBookingEditParams = z
.object({
title: z.string().optional(),
startTime: z.date().optional(),
endTime: z.date().optional(),
startTime: iso8601.optional(),
endTime: iso8601.optional(),
})
.strict();
export const schemaBookingEditBodyParams = schemaBookingBaseBodyParams.merge(schemaBookingEditParams);
export const schemaBookingReadPublic = Booking.extend({
attendees: z.array(
_AttendeeModel.pick({
attendees: z
.array(
_AttendeeModel.pick({
email: true,
name: true,
timeZone: true,
locale: true,
})
)
.optional(),
user: _UserModel
.pick({
email: true,
name: true,
timeZone: true,
locale: true,
})
),
user: _UserModel.pick({
email: true,
name: true,
timeZone: true,
locale: true,
}),
.optional(),
}).pick({
id: true,
userId: true,