Fixing PLans page

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-08 14:12:08 +00:00
parent da3b45d1c7
commit 144e955b92
24 changed files with 1992 additions and 1105 deletions

View File

@@ -655,7 +655,8 @@ export async function getAvailablePaymentMethods(): Promise<{
const response = await fetchAPI('/v1/billing/payment-methods/');
// Frontend guard: only allow the simplified set we currently support
const allowed = new Set(['bank_transfer', 'manual']);
const filtered = (response.results || []).filter((m: PaymentMethod) => allowed.has(m.type));
const results = Array.isArray(response.results) ? response.results : [];
const filtered = results.filter((m: PaymentMethod) => allowed.has(m.type));
return { results: filtered, count: filtered.length };
}
@@ -830,6 +831,8 @@ export interface Plan {
interval?: 'month' | 'year';
description?: string;
is_active?: boolean;
is_featured?: boolean;
annual_discount_percent?: number;
features?: string[];
limits?: Record<string, any>;
display_order?: number;