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

This reverts commit 6868474c92.

Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
Omar LópezandBailey Pumfleet authored and GitHub committed 2021-10-07 15:14:47 +00:00
1 parent a9ee2ef9ae
commit 30f97117e8
19 files changed
+956 -62

No files matched your search

+6 -5
View File
@@ -136,11 +136,6 @@ 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({
@@ -174,6 +169,12 @@ 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,