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.

a small fix

Kiran Kd947fb04ce8a
diff --git a/apps/web/lib/webhook/api.ts b/apps/web/lib/webhook/api.ts
index b275bc4652..cdcd1abb29 100644
--- a/apps/web/lib/webhook/api.ts
+++ b/apps/web/lib/webhook/api.ts
@@ -1,4 +1,5 @@
import { linkCache } from "@/lib/api/links/cache";
+import { createId } from "@/lib/api/utils";
import { prisma } from "@/lib/prisma";
import { webhookCache } from "@/lib/webhook/cache";
import { WEBHOOK_ID_PREFIX } from "@/lib/webhook/constants";
@@ -6,7 +7,6 @@ import {
identifyWebhookReceiver,
isLinkLevelWebhook,
} from "@/lib/webhook/utils";
-import { nanoid } from "@dub/utils";
import { Project } from "@prisma/client";
import { waitUntil } from "@vercel/functions";
import { WebhookTrigger } from "../types";
@@ -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,