mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix(billing): use addon name from API instead of hardcoded label map
The plan summary table used a hardcoded `addon_<key> -> label` lookup to render addon line items, with a fallback that called every unknown addon an "overage". Switch to reading `addon.name` from the API response, which the aggregation endpoint now populates from the addon catalog. The hardcoded map stays as a fallback for older cloud builds that don't yet send `addon.name`, and a plain resourceId is the final fallback in place of the misleading "overage (N)" string. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -295,7 +295,10 @@
|
||||
};
|
||||
|
||||
// addons (additional members, projects, etc.)
|
||||
const billingAddonNames: Record<string, string> = {
|
||||
// Fallback labels for older cloud builds that don't yet send `addon.name`
|
||||
// on the resource entry. Once the cloud rollout is complete this map can
|
||||
// be removed entirely.
|
||||
const billingAddonNamesFallback: Record<string, string> = {
|
||||
addon_baa: 'HIPAA BAA'
|
||||
};
|
||||
|
||||
@@ -315,8 +318,9 @@
|
||||
? 'Additional members'
|
||||
: addon.resourceId === 'projects'
|
||||
? 'Additional projects'
|
||||
: (billingAddonNames[addon.resourceId] ??
|
||||
`${addon.resourceId} overage (${formatNum(addon.value)})`),
|
||||
: addon.name ||
|
||||
billingAddonNamesFallback[addon.resourceId] ||
|
||||
addon.resourceId,
|
||||
usage: '',
|
||||
price: formatCurrency(addon.amount)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user