Feature/additional fields (#189)
Added timeZone, attendees.(email, name, timeZone, locale), user.(email, name, timeZone, locale) & metadata
This commit is contained in:
1 parent
07b011424f
commit
ce2df7641f
5 files changed
+111
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { _BookingModel as Booking } from "@calcom/prisma/zod";
|
||||
import { _BookingModel as Booking, _AttendeeModel, _UserModel } from "@calcom/prisma/zod";
|
||||
import { extendedBookingCreateBody } from "@calcom/prisma/zod-utils";
|
||||
|
||||
import { schemaQueryUserId } from "./shared/queryUserId";
|
||||
@@ -27,7 +27,22 @@ const schemaBookingEditParams = z
|
||||
|
||||
export const schemaBookingEditBodyParams = schemaBookingBaseBodyParams.merge(schemaBookingEditParams);
|
||||
|
||||
export const schemaBookingReadPublic = Booking.pick({
|
||||
export const schemaBookingReadPublic = Booking.extend({
|
||||
attendees: z.array(
|
||||
_AttendeeModel.pick({
|
||||
email: true,
|
||||
name: true,
|
||||
timeZone: true,
|
||||
locale: true,
|
||||
})
|
||||
),
|
||||
user: _UserModel.pick({
|
||||
email: true,
|
||||
name: true,
|
||||
timeZone: true,
|
||||
locale: true,
|
||||
}),
|
||||
}).pick({
|
||||
id: true,
|
||||
userId: true,
|
||||
description: true,
|
||||
@@ -36,4 +51,8 @@ export const schemaBookingReadPublic = Booking.pick({
|
||||
title: true,
|
||||
startTime: true,
|
||||
endTime: true,
|
||||
timeZone: true,
|
||||
attendees: true,
|
||||
user: true,
|
||||
metadata: true,
|
||||
});
|
||||
Reference in new issue
Block a user