mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 02:15:05 +03:00
Merge pull request #13412 from supabase/fix/enterprise-addon-update-page
Fix prop error in enterpriseupdate page
This commit is contained in:
1 file changed
+9
-4
@@ -1,5 +1,4 @@
|
||||
import { FC, useState } from 'react'
|
||||
import Router from 'next/router'
|
||||
import * as Tooltip from '@radix-ui/react-tooltip'
|
||||
import { Listbox, IconLoader, Button, IconPlus, IconAlertCircle, IconCreditCard } from 'ui'
|
||||
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
||||
@@ -82,6 +81,9 @@ const PaymentSummaryPanel: FC<Props> = ({
|
||||
const { ui } = useStore()
|
||||
const projectRegion = ui.selectedProject?.region
|
||||
|
||||
// [Joshen] Point of refactor: Current plan can just be currentSubscription.tier
|
||||
// Reduce one unnecessary prop
|
||||
|
||||
const canUpdatePaymentMethods = checkPermissions(
|
||||
PermissionAction.BILLING_WRITE,
|
||||
'stripe.payment_methods'
|
||||
@@ -90,9 +92,12 @@ const PaymentSummaryPanel: FC<Props> = ({
|
||||
const [showConfirmModal, setShowConfirmModal] = useState(false)
|
||||
|
||||
const selectedPlanCost =
|
||||
selectedPlan.prices.find(
|
||||
(price: AddonPrice) => price.id === selectedPlan.metadata.default_price_id
|
||||
)?.unit_amount ?? 0
|
||||
selectedPlan !== undefined
|
||||
? selectedPlan.prices.find(
|
||||
(price: AddonPrice) => price.id === selectedPlan.metadata.default_price_id
|
||||
)?.unit_amount ?? 0
|
||||
: currentSubscription?.tier.unit_amount ?? 0
|
||||
|
||||
const totalSelectedAddonCost = Object.keys(selectedAddons)
|
||||
.map((productName) => {
|
||||
const product = (selectedAddons as any)[productName]
|
||||
|
||||
Reference in new issue
Block a user