fix admin login issue
Build & Push / Pipeline Tests (push) Successful in 1m53s
Test / Type Check (all packages) (push) Successful in 54s
Build & Push / Build & Push Docker Image (push) Successful in 3m29s
Test / API Unit Tests (push) Successful in 1m14s
Test / Homepage Unit Tests (push) Successful in 48s
Test / Carplace Unit Tests (push) Successful in 42s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 44s
Test / API Integration Tests (push) Successful in 1m8s
Build & Push / Pipeline Tests (push) Successful in 1m53s
Test / Type Check (all packages) (push) Successful in 54s
Build & Push / Build & Push Docker Image (push) Successful in 3m29s
Test / API Unit Tests (push) Successful in 1m14s
Test / Homepage Unit Tests (push) Successful in 48s
Test / Carplace Unit Tests (push) Successful in 42s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 44s
Test / API Integration Tests (push) Successful in 1m8s
This commit is contained in:
@@ -139,6 +139,36 @@ const PLAN_LABELS: Record<Plan, string> = {
|
||||
ENTERPRISE: 'Enterprise',
|
||||
}
|
||||
|
||||
function mergePlanPrices(overrides?: Record<string, Record<string, Record<string, number>>> | null) {
|
||||
const result: Record<string, Record<string, Record<string, number>>> = {
|
||||
STARTER: {
|
||||
MONTHLY: { ...PLAN_PRICES.STARTER.MONTHLY },
|
||||
ANNUAL: { ...PLAN_PRICES.STARTER.ANNUAL },
|
||||
},
|
||||
GROWTH: {
|
||||
MONTHLY: { ...PLAN_PRICES.GROWTH.MONTHLY },
|
||||
ANNUAL: { ...PLAN_PRICES.GROWTH.ANNUAL },
|
||||
},
|
||||
PRO: {
|
||||
MONTHLY: { ...PLAN_PRICES.PRO.MONTHLY },
|
||||
ANNUAL: { ...PLAN_PRICES.PRO.ANNUAL },
|
||||
},
|
||||
ENTERPRISE: {
|
||||
MONTHLY: { ...PLAN_PRICES.ENTERPRISE.MONTHLY },
|
||||
ANNUAL: { ...PLAN_PRICES.ENTERPRISE.ANNUAL },
|
||||
},
|
||||
}
|
||||
|
||||
for (const [plan, periods] of Object.entries(overrides ?? {})) {
|
||||
result[plan] = result[plan] ?? {}
|
||||
for (const [period, currencies] of Object.entries(periods ?? {})) {
|
||||
result[plan]![period] = { ...(result[plan]?.[period] ?? {}), ...currencies }
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
const PAYMENT_EVIDENCE_MAX_FILES = 3
|
||||
const PAYMENT_EVIDENCE_MAX_FILE_SIZE = 10 * 1024 * 1024
|
||||
const PAYMENT_EVIDENCE_ACCEPT = 'application/pdf,image/jpeg,image/png,.pdf,.jpg,.jpeg,.png'
|
||||
@@ -527,7 +557,7 @@ export default function SubscriptionPage() {
|
||||
apiFetch<Record<string, Record<string, Record<string, number>>>>('/subscriptions/plans'),
|
||||
apiFetch<PlanFeature[]>('/subscriptions/features'),
|
||||
])
|
||||
if (prices && Object.keys(prices).length > 0) setPlanPrices(prices)
|
||||
setPlanPrices(mergePlanPrices(prices))
|
||||
if (features) setPlanFeaturesList(features)
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user