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';
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();
};