feat: Implement zone management features including creation, deletion, and updates

- Added zone handling in the Line component for removing and updating zones based on points.
- Enhanced Point component to support snapping and updating zone positions.
- Introduced zone-related API calls for upserting and deleting zones.
- Updated zone store to manage zones more effectively, including methods for removing zones by points and getting zones by point IDs.
- Improved zone instance rendering to handle dynamic point connections.
- Refactored zone creation logic to allow for better interaction and snapping behavior.
- Updated API endpoints for zone operations to use version 1 of the API.
This commit is contained in:
2025-06-30 12:22:42 +05:30
parent 90df6c2b01
commit 7124a819b6
18 changed files with 601 additions and 697 deletions

View File

@@ -1,12 +1,12 @@
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
export const upsertWallApi = async (
export const upsertZoneApi = async (
projectId: string,
versionId: string,
ZoneData: Zone
zoneData: Zone
) => {
try {
const response = await fetch(`${url_Backend_dwinzo}/api/V2/UpsertZone`, {
const response = await fetch(`${url_Backend_dwinzo}/api/V1/UpsertZone`, {
method: "POST",
headers: {
Authorization: "Bearer <access_token>",
@@ -14,7 +14,7 @@ export const upsertWallApi = async (
token: localStorage.getItem("token") || "",
refresh_token: localStorage.getItem("refreshToken") || "",
},
body: JSON.stringify({ projectId, versionId, ZoneData }),
body: JSON.stringify({ projectId, versionId, zoneData }),
});
const newAccessToken = response.headers.get("x-access-token");