fixes fixes fixes tenaancy

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-09 02:43:51 +00:00
parent 92211f065b
commit 72d0b6b0fd
23 changed files with 1428 additions and 19 deletions

View File

@@ -15,7 +15,7 @@ import PaymentConfirmationModal from './PaymentConfirmationModal';
interface Invoice {
id: number;
invoice_number: string;
total_amount: string;
total_amount: string; // Backend returns 'total_amount' in serialized response
currency: string;
status: string;
due_date?: string;
@@ -75,8 +75,9 @@ export default function PendingPaymentBanner({ className = '' }: PendingPaymentB
});
const pmData = await pmResponse.json();
if (pmResponse.ok && pmData.success && pmData.results?.length > 0) {
setPaymentMethod(pmData.results[0]);
// API returns array directly from DRF Response
if (pmResponse.ok && Array.isArray(pmData) && pmData.length > 0) {
setPaymentMethod(pmData[0]);
}
}
} catch (err) {