update post request

platform-api-poc-fastify
Ryukemeister 2023-10-27 18:11:54 +05:30
parent 25f4273124
commit fcabcf7266
1 changed files with 39 additions and 19 deletions

View File

@ -1,24 +1,44 @@
import { db } from '../../lib/db'; import { db } from '../../lib/db';
export const createBooking = async (booking: { id: number }) => { export const createBooking = async ({
db.insertInto('Booking') name,
email,
timeZone,
}: {
name: string;
email: string;
timeZone: string;
}) => {
await db
.insertInto('Attendee')
.values({ .values({
responses: { id: 6969,
email: '{{$randomExampleEmail}}', email: 'sahalrajiv690000000@gmail.com',
name: '{{$randomFullName}}', name: 'Ryukeeeeee',
notes: '{{$randomCatchPhrase}}', timeZone: 'Europe/London',
guests: [], bookingId: 16,
phone: '{{$randomPhoneNumber}}', locale: 'en',
},
start: '{{start}}',
end: '{{end}}',
eventTypeId: 3,
timeZone: 'America/Mazatlan',
language: 'en',
location: '',
metadata: {},
hasHashedBookingLink: false,
hashedLink: null,
}) })
.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();
}; };