From fcabcf7266cf871d85d74024d7c67b7684407482 Mon Sep 17 00:00:00 2001 From: Ryukemeister Date: Fri, 27 Oct 2023 18:11:54 +0530 Subject: [PATCH] update post request --- .../src/booking/repository/createBooking.ts | 58 +++++++++++++------ 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/apps/platform/api/src/booking/repository/createBooking.ts b/apps/platform/api/src/booking/repository/createBooking.ts index 5b7fc14ef5..7f4406506d 100644 --- a/apps/platform/api/src/booking/repository/createBooking.ts +++ b/apps/platform/api/src/booking/repository/createBooking.ts @@ -1,24 +1,44 @@ import { db } from '../../lib/db'; -export const createBooking = async (booking: { id: number }) => { - db.insertInto('Booking') +export const createBooking = async ({ + name, + email, + timeZone, +}: { + name: string; + email: string; + timeZone: string; +}) => { + await db + .insertInto('Attendee') .values({ - responses: { - email: '{{$randomExampleEmail}}', - name: '{{$randomFullName}}', - notes: '{{$randomCatchPhrase}}', - guests: [], - phone: '{{$randomPhoneNumber}}', - }, - start: '{{start}}', - end: '{{end}}', - eventTypeId: 3, - timeZone: 'America/Mazatlan', - language: 'en', - location: '', - metadata: {}, - hasHashedBookingLink: false, - hashedLink: null, + id: 6969, + email: 'sahalrajiv690000000@gmail.com', + name: 'Ryukeeeeee', + timeZone: 'Europe/London', + bookingId: 16, + locale: 'en', }) - .executeTakeFirst(); + .execute(); + + // db.insertInto('Booking') + // .values({ + // responses: { + // email: '{{$randomExampleEmail}}', + // name: '{{$randomFullName}}', + // notes: '{{$randomCatchPhrase}}', + // guests: [], + // phone: '{{$randomPhoneNumber}}', + // }, + // start: '{{start}}', + // end: '{{end}}', + // eventTypeId: 3, + // timeZone: 'America/Mazatlan', + // language: 'en', + // location: '', + // metadata: {}, + // hasHashedBookingLink: false, + // hashedLink: null, + // }) + // .executeTakeFirst(); };