Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove unused method

Kiran Kd7910fca86ff
diff --git a/apps/web/lib/webhook/publish.ts b/apps/web/lib/webhook/publish.ts
index 916572624d..499864052b 100644
--- a/apps/web/lib/webhook/publish.ts
+++ b/apps/web/lib/webhook/publish.ts
@@ -2,7 +2,6 @@ import { prisma } from "@/lib/prisma";
import { WebhookTrigger, WorkspaceProps } from "../types";
import { sendWebhooks } from "./qstash";
import {
- ClickEventDataProps,
LeadEventDataProps,
LinkEventDataProps,
SaleEventDataProps,
@@ -16,7 +15,7 @@ export const sendWorkspaceWebhook = async ({
}: {
trigger: WebhookTrigger;
workspace: Pick<WorkspaceProps, "id" | "webhookEnabled">;
- data: LinkEventDataProps;
+ data: LinkEventDataProps | LeadEventDataProps | SaleEventDataProps;
}) => {
if (!workspace.webhookEnabled) {
return;
@@ -38,40 +37,3 @@ export const sendWorkspaceWebhook = async ({
return sendWebhooks({ trigger, webhooks, data });
};
-
-// Send link level webhook
-export const sendLinkWebhook = async ({
- trigger,
- linkId,
- data,
-}: {
- trigger: WebhookTrigger;
- linkId: string;
- data: ClickEventDataProps | LeadEventDataProps | SaleEventDataProps;
-}) => {
- const linkWebhooks = await prisma.linkWebhook.findMany({
- where: {
- linkId,
- webhook: {
- triggers: {
- array_contains: [trigger],
- },
- },
- },
- include: {
- webhook: {
- select: {
- id: true,
- url: true,
- secret: true,
- },
- },
- },
- });
-
- return sendWebhooks({
- trigger,
- webhooks: linkWebhooks.map(({ webhook }) => webhook),
- data,
- });
-};