Skip to content

Commit f95f93d

Browse files
committed
fix migration and test
1 parent 6d4e37c commit f95f93d

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

apps/backend/prisma/migrations/20260224000000_managed_email_domains/migration.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CREATE TYPE "ManagedEmailDomainStatus" AS ENUM ('PENDING_DNS', 'PENDING_VERIFICATION', 'VERIFIED', 'APPLIED', 'FAILED');
22

33
CREATE TABLE "ManagedEmailDomain" (
4-
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
4+
"id" UUID NOT NULL,
55
"tenancyId" UUID NOT NULL,
66
"projectId" TEXT NOT NULL,
77
"branchId" TEXT NOT NULL,
@@ -17,7 +17,7 @@ CREATE TABLE "ManagedEmailDomain" (
1717
"appliedAt" TIMESTAMP(3),
1818
"lastWebhookAt" TIMESTAMP(3),
1919
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20-
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20+
"updatedAt" TIMESTAMP(3) NOT NULL,
2121

2222
CONSTRAINT "ManagedEmailDomain_pkey" PRIMARY KEY ("id"),
2323
CONSTRAINT "ManagedEmailDomain_tenancyId_fkey" FOREIGN KEY ("tenancyId") REFERENCES "Tenancy"("id") ON DELETE CASCADE ON UPDATE CASCADE

apps/backend/src/lib/managed-email-onboarding.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ export type ManagedEmailListItem = {
5757

5858
function shouldUseMockManagedEmailOnboarding() {
5959
const nodeEnvironment = getNodeEnvironment();
60-
if (nodeEnvironment === "development") {
60+
if (nodeEnvironment === "development" || nodeEnvironment === "test") {
6161
const resendApiKey = getEnvVariable("STACK_RESEND_API_KEY", "");
62-
const dnsimpleApiToken = getEnvVariable("STACK_DNSIMPLE_API_TOKEN", "");
63-
const dnsimpleAccountId = getEnvVariable("STACK_DNSIMPLE_ACCOUNT_ID", "");
64-
if (resendApiKey.startsWith("mock_") || dnsimpleApiToken.length === 0 || dnsimpleAccountId.length === 0) {
62+
if (resendApiKey === "mock_resend_api_key") {
6563
return true;
6664
}
6765
}

0 commit comments

Comments
 (0)