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.

fix the tests

Kiran K63c524542b30
diff --git a/apps/web/app/api/domains/[domain]/route.ts b/apps/web/app/api/domains/[domain]/route.ts
index 39f7909331..d527b428af 100644
--- a/apps/web/app/api/domains/[domain]/route.ts
+++ b/apps/web/app/api/domains/[domain]/route.ts
@@ -90,6 +90,9 @@ export const PATCH = withWorkspace(
expiredUrl,
}),
},
+ include: {
+ registeredDomain: true,
+ },
});
waitUntil(
diff --git a/apps/web/app/api/domains/route.ts b/apps/web/app/api/domains/route.ts
index f1d306fcdc..662a4191b9 100644
--- a/apps/web/app/api/domains/route.ts
+++ b/apps/web/app/api/domains/route.ts
@@ -135,6 +135,7 @@ export const POST = withWorkspace(
}),
},
}),
+
createLink({
...DEFAULT_LINK_PROPS,
domain: slug,
@@ -146,9 +147,15 @@ export const POST = withWorkspace(
}),
]);
- return NextResponse.json(DomainSchema.parse(domainRecord), {
- status: 201,
- });
+ return NextResponse.json(
+ DomainSchema.parse({
+ ...domainRecord,
+ registeredDomain: null,
+ }),
+ {
+ status: 201,
+ },
+ );
},
{
requiredPermissions: ["domains.write"],
diff --git a/apps/web/lib/zod/schemas/domains.ts b/apps/web/lib/zod/schemas/domains.ts
index a982c10165..4313bc5303 100644
--- a/apps/web/lib/zod/schemas/domains.ts
+++ b/apps/web/lib/zod/schemas/domains.ts
@@ -42,7 +42,7 @@ export const DomainSchema = z.object({
createdAt: z.date().describe("The date the domain was created."),
expiresAt: z.date().describe("The date the domain expires."),
})
- .nullish()
+ .nullable()
.describe("The registered domain record."),
});