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.

Update api.ts

Kiran K503a698183b9
diff --git a/apps/web/lib/webhook/api.ts b/apps/web/lib/webhook/api.ts
index b275bc4652..fe64aef26b 100644
--- a/apps/web/lib/webhook/api.ts
+++ b/apps/web/lib/webhook/api.ts
@@ -6,9 +6,9 @@ import {
identifyWebhookReceiver,
isLinkLevelWebhook,
} from "@/lib/webhook/utils";
-import { nanoid } from "@dub/utils";
import { Project } from "@prisma/client";
import { waitUntil } from "@vercel/functions";
+import { createId } from "../api/utils";
import { WebhookTrigger } from "../types";
import { createWebhookSecret } from "./secret";
@@ -29,7 +29,7 @@ export async function addWebhook({
}) {
const webhook = await prisma.webhook.create({
data: {
- id: `${WEBHOOK_ID_PREFIX}${nanoid(25)}`,
+ id: createId({ prefix: WEBHOOK_ID_PREFIX }),
name,
url,
triggers,