diff --git a/frontend/src/components/Applications/ApplicationExecutionModal.js b/frontend/src/components/Applications/ApplicationExecutionModal.js index 8843b19..13e6cb3 100644 --- a/frontend/src/components/Applications/ApplicationExecutionModal.js +++ b/frontend/src/components/Applications/ApplicationExecutionModal.js @@ -40,18 +40,18 @@ const ApplicationExecutionModal = ({ application, propertyDetails, onClose, onCo const planDetails = planResponse.data.data.plan; console.log('Fetched plan details:', planDetails); - console.log('Plan details areas:', planDetails.areas); + console.log('Plan details sections:', planDetails.sections); - if (planDetails.areas && planDetails.areas.length > 0) { - setSections(planDetails.areas); + if (planDetails.sections && planDetails.sections.length > 0) { + setSections(planDetails.sections); // Calculate center from section coordinates let totalLat = 0; let totalLng = 0; let pointCount = 0; - planDetails.areas.forEach(area => { - let polygonData = area.polygonData; + planDetails.sections.forEach(section => { + let polygonData = section.polygonData; if (typeof polygonData === 'string') { try { polygonData = JSON.parse(polygonData); @@ -78,7 +78,7 @@ const ApplicationExecutionModal = ({ application, propertyDetails, onClose, onCo } // Fallback: If we have property details, use those sections - if ((!planDetails.areas || planDetails.areas.length === 0) && propertyDetails?.sections) { + if ((!planDetails.sections || planDetails.sections.length === 0) && propertyDetails?.sections) { const applicationSectionIds = application.sections?.map(s => s.id) || []; const relevantSections = propertyDetails.sections.filter(section => applicationSectionIds.includes(section.id)