asdfasdfsa
This commit is contained in:
@@ -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 || []
|
||||
|
||||
Reference in New Issue
Block a user