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