Files
Dwinzo_dev/app/src/services/factoryBuilder/aisle/deleteAisleApi.ts
Jerald-Golden-B f295a04322 feat: Integrate versioning into collaboration and simulation modules
- Added version context to socket responses, enabling version-specific data retrieval.
- Updated API calls in various components to include versionId for better data management.
- Removed deprecated setFloorItemApi and replaced it with setAssetsApi for asset management.
- Enhanced error handling and logging for API interactions.
- Refactored multiple components to utilize selectedVersion for consistent behavior across the application.
2025-06-21 12:34:29 +05:30

30 lines
1007 B
TypeScript

let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
export const deleteAisleApi = async (aisleUuid: string, projectId: string, versionId: string) => {
try {
const response = await fetch(`${url_Backend_dwinzo}/api/V1/DeleteAisle`, {
method: "PATCH",
headers: {
Authorization: "Bearer <access_token>", // Replace with actual token
"Content-Type": "application/json",
token: localStorage.getItem("token") || "", // Coerce null to empty string
refresh_token: localStorage.getItem("refreshToken") || "",
},
body: JSON.stringify({ aisleUuid, projectId }),
});
if (!response.ok) {
throw new Error("Failed to clearPanel in the zone");
}
const result = await response.json();
// console.log('result: ', result);
return result;
} catch (error) {
if (error instanceof Error) {
console.log(error.message);
} else {
console.log("An unknown error occurred");
}
}
};