Revert "Feature/cal 274 add webhooks (#628)" (#854)

This reverts commit 4c07faefe7.
This commit is contained in:
Omar López authored and GitHub committed 2021-10-05 02:30:00 +01:00
1 parent 4c07faefe7
commit 6868474c92
19 files changed
+66 -960

No files matched your search

+5 -6
View File
@@ -136,6 +136,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const openingHours = req.body.availability.openingHours || [];
// const overrides = req.body.availability.dateOverrides || [];
await prisma.availability.deleteMany({
where: {
eventTypeId: +req.body.id,
},
});
Promise.all(
openingHours.map((schedule) =>
prisma.availability.create({
@@ -169,12 +174,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
},
});
await prisma.webhookEventTypes.deleteMany({
where: {
eventTypeId: req.body.id,
},
});
await prisma.eventType.delete({
where: {
id: req.body.id,