adds app-store to be transpiled to fix build

This commit is contained in:
Agusti Fernandez Pardo committed 2022-04-13 18:53:44 +02:00
1 parent a064983002
commit 1405f7a861
2 files changed
+11 -6

No files matched your search

+6 -1
View File
@@ -1,6 +1,11 @@
// https://www.npmjs.com/package/next-transpile-modules
// This makes our @calcom/prisma package from the monorepo to be transpiled and usable by API
const withTM = require("next-transpile-modules")(["@calcom/prisma", "@calcom/lib", "@calcom/ee"]);
const withTM = require("next-transpile-modules")([
"@calcom/app-store",
"@calcom/prisma",
"@calcom/lib",
"@calcom/ee",
]);
// use something like withPlugins([withTM], {}) if more plugins added later.
+5 -5
View File
@@ -67,10 +67,7 @@ async function createOrlistAllBookingReferences(
throw new Error("Invalid request body");
}
const data = await prisma.bookingReference.create({
data: { ...safe.data },
});
const booking_reference = schemaBookingReferencePublic.parse(data);
// const booking_reference = schemaBookingReferencePublic.parse(data);
const userId = await getCalcomUserId(res);
const userWithBookings = await prisma.user.findUnique({
where: { id: userId },
@@ -81,7 +78,10 @@ async function createOrlistAllBookingReferences(
}
const userBookingIds = userWithBookings.bookings.map((booking: any) => booking.id).flat();
if (userBookingIds.includes(safe.data.bookingId)) {
if (data) {
const booking_reference = await prisma.bookingReference.create({
data: { ...safe.data },
});
if (booking_reference) {
res.status(201).json({
booking_reference,
message: "BookingReference created successfully",