From 5d0cfdef478da816595a7f8379f202a27c4165fb Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 13 May 2025 21:05:12 +0200 Subject: [PATCH] more fixes --- src/api/wrenClient.ts | 11 +++++++---- src/components/OffsetOrder.tsx | 24 ------------------------ 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/api/wrenClient.ts b/src/api/wrenClient.ts index c9cb243..23fafb9 100644 --- a/src/api/wrenClient.ts +++ b/src/api/wrenClient.ts @@ -156,11 +156,14 @@ export async function getPortfolios(): Promise { 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 } }; }) || []; diff --git a/src/components/OffsetOrder.tsx b/src/components/OffsetOrder.tsx index 5a0e466..2d8005e 100644 --- a/src/components/OffsetOrder.tsx +++ b/src/components/OffsetOrder.tsx @@ -339,30 +339,6 @@ export function OffsetOrder({ tons, monetaryAmount, onBack, calculatorType }: Pr ${project.pricePerTon.toFixed(2)} - {project.location && ( -
- Location: - {project.location} -
- )} - {project.type && ( -
- Type: - {project.type} -
- )} - {project.verificationStandard && ( -
- Standard: - {project.verificationStandard} -
- )} - {project.impactMetrics?.co2Reduced && ( -
- Impact: - {project.impactMetrics.co2Reduced.toLocaleString()} tons CO₂ -
- )} ))}