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.

Add groupId to partner creation API

Kiran K7b2d7f2479b6
diff --git a/apps/web/app/(ee)/api/partners/route.ts b/apps/web/app/(ee)/api/partners/route.ts
index 62e941e79f..ad7c00d0f5 100644
--- a/apps/web/app/(ee)/api/partners/route.ts
+++ b/apps/web/app/(ee)/api/partners/route.ts
@@ -52,6 +52,7 @@ export const POST = withWorkspace(
description = null,
tenantId,
linkProps,
+ groupId,
} = createPartnerSchema.parse(await parseRequestBody(req));
const program = await getProgramOrThrow({
@@ -84,6 +85,7 @@ export const POST = withWorkspace(
description,
},
tenantId,
+ groupId,
});
return NextResponse.json(enrolledPartner, {
diff --git a/apps/web/lib/zod/schemas/partners.ts b/apps/web/lib/zod/schemas/partners.ts
index 527186273c..086cec4b79 100644
--- a/apps/web/lib/zod/schemas/partners.ts
+++ b/apps/web/lib/zod/schemas/partners.ts
@@ -374,6 +374,12 @@ export const createPartnerSchema = z.object({
.describe(
"The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner.",
),
+ groupId: z
+ .string()
+ .optional()
+ .describe(
+ "The group ID to add the partner to. If not provided, the partner will be added to the default group.",
+ ),
country: z
.string()
.nullish()