Skip to content

Commit

Permalink
fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devkiran committed Oct 14, 2024
1 parent 3bfe002 commit 63c5245
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions apps/web/app/api/domains/[domain]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export const PATCH = withWorkspace(
expiredUrl,
}),
},
include: {
registeredDomain: true,
},
});

waitUntil(
Expand Down
13 changes: 10 additions & 3 deletions apps/web/app/api/domains/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const POST = withWorkspace(
}),
},
}),

createLink({
...DEFAULT_LINK_PROPS,
domain: slug,
Expand All @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/zod/schemas/domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
});

Expand Down

0 comments on commit 63c5245

Please sign in to comment.