migrate webhookTriggers and workflows apis (#19875)

This commit is contained in:
Benny Joo authored and GitHub committed 2025-03-10 14:35:11 +00:00
1 parent f2ca2bdc83
commit 631c5f7c53
12 files changed
+52 -68

No files matched your search

-23
View File
@@ -1,23 +0,0 @@
/* Cron job for scheduled webhook events triggers */
import type { NextApiRequest, NextApiResponse } from "next";
import { defaultHandler } from "@calcom/lib/server/defaultHandler";
import prisma from "@calcom/prisma";
import { handleWebhookScheduledTriggers } from "./handleWebhookScheduledTriggers";
async function handler(req: NextApiRequest, res: NextApiResponse) {
const apiKey = req.headers.authorization || req.query.apiKey;
if (process.env.CRON_API_KEY !== apiKey) {
res.status(401).json({ message: "Not authenticated" });
return;
}
await handleWebhookScheduledTriggers(prisma);
res.json({ ok: true });
}
export default defaultHandler({
POST: Promise.resolve({ default: handler }),
});