more fixes

This commit is contained in:
Matt 2025-05-13 21:05:12 +02:00
parent 43fca42b7f
commit 5d0cfdef47
2 changed files with 7 additions and 28 deletions

View File

@ -156,11 +156,14 @@ export async function getPortfolios(): Promise<Portfolio[]> {
imageUrl: project.image_url, // Map from snake_case API response
pricePerTon: projectPricePerTon,
percentage: projectPercentage, // Include percentage field
location: project.location || 'Global',
type: project.type || 'Nature Based',
verificationStandard: project.verification_standard || 'Gold Standard',
// Remove fields that aren't in the API
// The required type fields are still in the type definition for compatibility
// but we no longer populate them with default values
location: '',
type: '',
verificationStandard: '',
impactMetrics: {
co2Reduced: project.impact_metrics?.co2_reduced || 5000
co2Reduced: 0
}
};
}) || [];

View File

@ -339,30 +339,6 @@ export function OffsetOrder({ tons, monetaryAmount, onBack, calculatorType }: Pr
${project.pricePerTon.toFixed(2)}
</span>
</div>
{project.location && (
<div className="flex justify-between">
<span className="text-gray-500">Location:</span>
<span className="text-gray-900">{project.location}</span>
</div>
)}
{project.type && (
<div className="flex justify-between">
<span className="text-gray-500">Type:</span>
<span className="text-gray-900">{project.type}</span>
</div>
)}
{project.verificationStandard && (
<div className="flex justify-between">
<span className="text-gray-500">Standard:</span>
<span className="text-gray-900">{project.verificationStandard}</span>
</div>
)}
{project.impactMetrics?.co2Reduced && (
<div className="flex justify-between">
<span className="text-gray-500">Impact:</span>
<span className="text-gray-900">{project.impactMetrics.co2Reduced.toLocaleString()} tons CO</span>
</div>
)}
</div>
</div>
))}