uuid automate in booking API
parent
110edd7dcc
commit
61e742ed5e
|
@ -13,7 +13,6 @@ const schemaBookingBaseBodyParams = Booking.pick({
|
|||
|
||||
const schemaBookingCreateParams = z
|
||||
.object({
|
||||
uid: z.string(),
|
||||
eventTypeId: z.number(),
|
||||
title: z.string(),
|
||||
startTime: z.date().or(z.string()),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { WebhookTriggerEvents } from "@prisma/client";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
|
@ -82,7 +83,7 @@ async function createOrlistAllBookings(
|
|||
return;
|
||||
}
|
||||
safe.data.userId = userId;
|
||||
const data = await prisma.booking.create({ data: { ...safe.data } });
|
||||
const data = await prisma.booking.create({ data: { id: uuidv4(), ...safe.data } });
|
||||
const booking = schemaBookingReadPublic.parse(data);
|
||||
|
||||
if (booking) {
|
||||
|
|
Loading…
Reference in New Issue