From 2471ee801bd7ca5d6458002308fafa0cfb0bbe43 Mon Sep 17 00:00:00 2001 From: NETRAKAMAL BARUA <77873211+JOSU9435@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:17:23 +0530 Subject: [PATCH] feat: hashed link retrieval from event types v1 api (#16437) * add hashed link retrieval from event types api v1 * remove id, eventTypeId from hashedLink field * Update event-type.ts * Update event-type.ts --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Co-authored-by: Peer Richelsen --- apps/api/v1/lib/validations/event-type.ts | 1 + apps/api/v1/pages/api/event-types/[id]/_get.ts | 1 + apps/api/v1/pages/api/event-types/_get.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/apps/api/v1/lib/validations/event-type.ts b/apps/api/v1/lib/validations/event-type.ts index f874ac143d..579f514f04 100644 --- a/apps/api/v1/lib/validations/event-type.ts +++ b/apps/api/v1/lib/validations/event-type.ts @@ -168,6 +168,7 @@ export const schemaEventTypeReadPublic = EventType.pick({ metadata: jsonSchema.nullable(), customInputs: customInputSchema.array().optional(), link: z.string().optional(), + hashedLink: z.object({ link: z.string() }).optional().nullable(), bookingFields: eventTypeBookingFields.optional().nullable(), }) ); diff --git a/apps/api/v1/pages/api/event-types/[id]/_get.ts b/apps/api/v1/pages/api/event-types/[id]/_get.ts index a4e4bad3ac..af70bffe17 100644 --- a/apps/api/v1/pages/api/event-types/[id]/_get.ts +++ b/apps/api/v1/pages/api/event-types/[id]/_get.ts @@ -51,6 +51,7 @@ export async function getHandler(req: NextApiRequest) { where: { id }, include: { customInputs: true, + hashedLink: { select: { link: true } }, team: { select: { slug: true } }, hosts: { select: { userId: true, isFixed: true } }, owner: { select: { username: true, id: true } }, diff --git a/apps/api/v1/pages/api/event-types/_get.ts b/apps/api/v1/pages/api/event-types/_get.ts index e3160da894..07d80d3201 100644 --- a/apps/api/v1/pages/api/event-types/_get.ts +++ b/apps/api/v1/pages/api/event-types/_get.ts @@ -56,6 +56,7 @@ async function getHandler(req: NextApiRequest) { }, include: { customInputs: true, + hashedLink: { select: { link: true } }, team: { select: { slug: true } }, hosts: { select: { userId: true, isFixed: true } }, owner: { select: { username: true, id: true } },