Set start and endTime to iso8601 (#198)
parent
ecd20d63c9
commit
1f9be423ad
|
@ -1,7 +1,7 @@
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { _BookingModel as Booking, _AttendeeModel, _UserModel } from "@calcom/prisma/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";
|
import { schemaQueryUserId } from "./shared/queryUserId";
|
||||||
|
|
||||||
|
@ -20,28 +20,32 @@ export const schemaBookingCreateBodyParams = extendedBookingCreateBody.merge(sch
|
||||||
const schemaBookingEditParams = z
|
const schemaBookingEditParams = z
|
||||||
.object({
|
.object({
|
||||||
title: z.string().optional(),
|
title: z.string().optional(),
|
||||||
startTime: z.date().optional(),
|
startTime: iso8601.optional(),
|
||||||
endTime: z.date().optional(),
|
endTime: iso8601.optional(),
|
||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
export const schemaBookingEditBodyParams = schemaBookingBaseBodyParams.merge(schemaBookingEditParams);
|
export const schemaBookingEditBodyParams = schemaBookingBaseBodyParams.merge(schemaBookingEditParams);
|
||||||
|
|
||||||
export const schemaBookingReadPublic = Booking.extend({
|
export const schemaBookingReadPublic = Booking.extend({
|
||||||
attendees: z.array(
|
attendees: z
|
||||||
_AttendeeModel.pick({
|
.array(
|
||||||
|
_AttendeeModel.pick({
|
||||||
|
email: true,
|
||||||
|
name: true,
|
||||||
|
timeZone: true,
|
||||||
|
locale: true,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.optional(),
|
||||||
|
user: _UserModel
|
||||||
|
.pick({
|
||||||
email: true,
|
email: true,
|
||||||
name: true,
|
name: true,
|
||||||
timeZone: true,
|
timeZone: true,
|
||||||
locale: true,
|
locale: true,
|
||||||
})
|
})
|
||||||
),
|
.optional(),
|
||||||
user: _UserModel.pick({
|
|
||||||
email: true,
|
|
||||||
name: true,
|
|
||||||
timeZone: true,
|
|
||||||
locale: true,
|
|
||||||
}),
|
|
||||||
}).pick({
|
}).pick({
|
||||||
id: true,
|
id: true,
|
||||||
userId: true,
|
userId: true,
|
||||||
|
|
Loading…
Reference in New Issue