Skip to content

Scheduling infrastructure for absolutely everyone.

Added location to bookings table

nicolasdf161d549822
diff --git a/pages/api/book/[user].ts b/pages/api/book/[user].ts
index df756da3071..a7f10b15bf7 100644
--- a/pages/api/book/[user].ts
+++ b/pages/api/book/[user].ts
@@ -336,6 +336,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
attendees: {
create: evt.attendees,
},
+ location: evt.location, // This is the raw location that can be processed by the EventManager.
confirmed: !selectedEventType.requiresConfirmation,
},
});
diff --git a/pages/api/book/confirm.ts b/pages/api/book/confirm.ts
index fb8b961abae..36cfb95eb6b 100644
--- a/pages/api/book/confirm.ts
+++ b/pages/api/book/confirm.ts
@@ -42,6 +42,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
endTime: true,
confirmed: true,
attendees: true,
+ location: true,
userId: true,
id: true,
uid: true,
diff --git a/prisma/migrations/20210725123357_add_location_to_booking/migration.sql b/prisma/migrations/20210725123357_add_location_to_booking/migration.sql
new file mode 100644
index 00000000000..f2874f5ea49
--- /dev/null
+++ b/prisma/migrations/20210725123357_add_location_to_booking/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "Booking" ADD COLUMN "location" TEXT;
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 83aed7249a9..d08335ac069 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -132,6 +132,7 @@ model Booking {
endTime DateTime
attendees Attendee[]
+ location String?
createdAt DateTime @default(now())
updatedAt DateTime?