From b10e138f870882326cab0f550e40c9d2700f3b8e Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Tue, 28 May 2024 19:04:18 +0800 Subject: [PATCH] refactor(console): support multi-region for paid plans --- .../CreateTenantModal/SelectTenantPlanModal/index.tsx | 4 ++-- packages/console/src/hooks/use-subscribe.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx b/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx index 1548bd7be..01d68c1e8 100644 --- a/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx +++ b/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx @@ -41,8 +41,8 @@ function SelectTenantPlanModal({ tenantData, onClose }: Props) { const { id: planId } = plan; try { if (planId === ReservedPlanId.Free) { - const { name, tag } = tenantData; - const newTenant = await cloudApi.post('/api/tenants', { body: { name, tag } }); + const { name, tag, regionName } = tenantData; + const newTenant = await cloudApi.post('/api/tenants', { body: { name, tag, regionName } }); reportToGoogle(GtagConversionId.CreateProductionTenant, { transactionId: newTenant.id }); onClose(newTenant); diff --git a/packages/console/src/hooks/use-subscribe.ts b/packages/console/src/hooks/use-subscribe.ts index fa7005ef0..6bb49a252 100644 --- a/packages/console/src/hooks/use-subscribe.ts +++ b/packages/console/src/hooks/use-subscribe.ts @@ -59,6 +59,7 @@ const useSubscribe = () => { tenantId, tenantName: tenantData?.name, tenantTag: tenantData?.tag, + tenantRegionName: tenantData?.regionName, }, });