fix(subscriptions): fix subscription banner not showing on merchant detail page
Fix 3 bugs preventing the subscription banner from rendering on
/admin/merchants/{id}: correct API response parsing for platforms and
tiers endpoints (response.items → response.platforms/response.tiers),
and replace broken model_validator with field_validator for tier code
extraction in the billing schema.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -102,7 +102,7 @@ function adminMerchantDetail() {
|
||||
async loadPlatforms() {
|
||||
try {
|
||||
const response = await apiClient.get('/admin/platforms');
|
||||
const platforms = response.items || response;
|
||||
const platforms = response.platforms || [];
|
||||
const oms = platforms.find(p => p.code === 'oms');
|
||||
if (oms) {
|
||||
this.platformId = oms.id;
|
||||
@@ -155,7 +155,7 @@ function adminMerchantDetail() {
|
||||
|
||||
try {
|
||||
const response = await apiClient.get('/admin/subscriptions/tiers');
|
||||
this.tiers = response.items || response;
|
||||
this.tiers = response.tiers || [];
|
||||
merchantDetailLog.info('Loaded tiers:', this.tiers.length);
|
||||
} catch (error) {
|
||||
merchantDetailLog.warn('Failed to load tiers:', error.message);
|
||||
|
||||
Reference in New Issue
Block a user