more fixes
This commit is contained in:
parent
43fca42b7f
commit
5d0cfdef47
@ -156,11 +156,14 @@ export async function getPortfolios(): Promise<Portfolio[]> {
|
|||||||
imageUrl: project.image_url, // Map from snake_case API response
|
imageUrl: project.image_url, // Map from snake_case API response
|
||||||
pricePerTon: projectPricePerTon,
|
pricePerTon: projectPricePerTon,
|
||||||
percentage: projectPercentage, // Include percentage field
|
percentage: projectPercentage, // Include percentage field
|
||||||
location: project.location || 'Global',
|
// Remove fields that aren't in the API
|
||||||
type: project.type || 'Nature Based',
|
// The required type fields are still in the type definition for compatibility
|
||||||
verificationStandard: project.verification_standard || 'Gold Standard',
|
// but we no longer populate them with default values
|
||||||
|
location: '',
|
||||||
|
type: '',
|
||||||
|
verificationStandard: '',
|
||||||
impactMetrics: {
|
impactMetrics: {
|
||||||
co2Reduced: project.impact_metrics?.co2_reduced || 5000
|
co2Reduced: 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}) || [];
|
}) || [];
|
||||||
|
|||||||
@ -339,30 +339,6 @@ export function OffsetOrder({ tons, monetaryAmount, onBack, calculatorType }: Pr
|
|||||||
${project.pricePerTon.toFixed(2)}
|
${project.pricePerTon.toFixed(2)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user