We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d318ba7 commit e55cc21Copy full SHA for e55cc21
apps/web/app/(ee)/api/email-domains/route.ts
@@ -92,18 +92,13 @@ export const POST = withWorkspace(
92
},
93
});
94
95
- waitUntil(
96
- (async () => {
97
- const { error } = await resend.domains.verify(resendDomain.id);
98
-
99
- if (error) {
100
- console.error("Error verifying resend domain", error);
101
- }
102
- })(),
103
- );
+ waitUntil(resend.domains.verify(resendDomain.id));
104
105
return NextResponse.json(EmailDomainSchema.parse(emailDomain));
106
} catch (error) {
+ // Cleanup to avoid orphaned Resend domains
+ waitUntil(resend.domains.remove(resendDomain.id));
+
107
if (error instanceof Prisma.PrismaClientKnownRequestError) {
108
if (error.code === "P2002") {
109
throw new DubApiError({
0 commit comments