fixes fixes fixes tenaancy
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user