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 savedSection = response.data.data.section;
// Convert backend format to frontend format
// Convert backend format to frontend format; parse polygonData if string
const poly = typeof savedSection.polygonData === 'string' ? JSON.parse(savedSection.polygonData) : savedSection.polygonData;
const newSection = {
id: savedSection.id,
name: savedSection.name,
coordinates: savedSection.polygonData.coordinates[0],
color: savedSection.polygonData.color,
coordinates: poly?.coordinates?.[0] || [],
color: poly?.color || currentColor,
area: savedSection.area,
grassType: savedSection.grassType || '',
grassTypes: savedSection.grassTypes || []