asdfasdfsa

This commit is contained in:
Jake Kasper
2025-09-05 12:35:16 -04:00
parent 3fc77a0683
commit e5605f0868

View File

@@ -661,13 +661,13 @@ const PropertyDetail = () => {
const response = await propertiesAPI.createSection(id, sectionData); const response = await propertiesAPI.createSection(id, sectionData);
const savedSection = response.data.data.section; const savedSection = response.data.data.section;
// Convert backend format to frontend format; parse polygonData if string
// Convert backend format to frontend format const poly = typeof savedSection.polygonData === 'string' ? JSON.parse(savedSection.polygonData) : savedSection.polygonData;
const newSection = { const newSection = {
id: savedSection.id, id: savedSection.id,
name: savedSection.name, name: savedSection.name,
coordinates: savedSection.polygonData.coordinates[0], coordinates: poly?.coordinates?.[0] || [],
color: savedSection.polygonData.color, color: poly?.color || currentColor,
area: savedSection.area, area: savedSection.area,
grassType: savedSection.grassType || '', grassType: savedSection.grassType || '',
grassTypes: savedSection.grassTypes || [] grassTypes: savedSection.grassTypes || []