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.

normalizeWorkspaceId

Steven Teybff26955e442
diff --git a/apps/web/app/(ee)/api/singular/webhook/route.ts b/apps/web/app/(ee)/api/singular/webhook/route.ts
index 1972ca05b6..2d2aefaef4 100644
--- a/apps/web/app/(ee)/api/singular/webhook/route.ts
+++ b/apps/web/app/(ee)/api/singular/webhook/route.ts
@@ -1,4 +1,5 @@
import { DubApiError, handleAndReturnErrorResponse } from "@/lib/api/errors";
+import { normalizeWorkspaceId } from "@/lib/api/workspace-id";
import { trackSingularLeadEvent } from "@/lib/integrations/singular/track-lead";
import { trackSingularSaleEvent } from "@/lib/integrations/singular/track-sale";
import { prisma } from "@dub/prisma";
@@ -25,7 +26,10 @@ const authSchema = z.object({
dub_workspace_id: z
.string()
.min(1, "dub_workspace_id is required")
- .describe(" Unique to identify the advertiser."),
+ .describe(
+ "The Singular advertiser's workspace ID on Dub (see https://d.to/id).",
+ )
+ .transform((v) => normalizeWorkspaceId(v)),
});
const singularWebhookToken = process.env.SINGULAR_WEBHOOK_TOKEN;