Merge remote-tracking branch 'origin/main-dev' into dev-collaboration
This commit is contained in:
@@ -6,8 +6,10 @@ export const adding3dWidgets = async (
|
||||
widget: {},
|
||||
projectId?: string,
|
||||
versionId?: string
|
||||
|
||||
|
||||
) => {
|
||||
|
||||
|
||||
try {
|
||||
const response = await fetch(`${url_Backend_dwinzo}/api/V1/widget3d/save`, {
|
||||
method: "POST",
|
||||
@@ -20,15 +22,16 @@ export const adding3dWidgets = async (
|
||||
body: JSON.stringify({ organization, zoneUuid, widget, projectId, versionId }),
|
||||
});
|
||||
|
||||
|
||||
const newAccessToken = response.headers.get("x-access-token");
|
||||
if (newAccessToken) {
|
||||
//console.log("New token received:", newAccessToken);
|
||||
//
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
console.error("Failed to add 3dwidget in the zone");
|
||||
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
@@ -36,9 +39,9 @@ export const adding3dWidgets = async (
|
||||
} catch (error) {
|
||||
echo.error("Failed to add 3d widget");
|
||||
if (error instanceof Error) {
|
||||
console.log(error.message);
|
||||
|
||||
} else {
|
||||
console.log("An unknown error occurred");
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,9 +2,13 @@ let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_UR
|
||||
|
||||
|
||||
export const get3dWidgetInput = async (chartId: string, organization: string, projectId?: string, versionId?: string) => {
|
||||
|
||||
|
||||
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${url_Backend_dwinzo}/api/v2/widget3D/${chartId}/${organization}`,
|
||||
`${url_Backend_dwinzo}/api/V1/widget3dData/${chartId}/${projectId}/${versionId}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -15,9 +19,10 @@ export const get3dWidgetInput = async (chartId: string, organization: string, pr
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const newAccessToken = response.headers.get("x-access-token");
|
||||
if (newAccessToken) {
|
||||
//console.log("New token received:", newAccessToken);
|
||||
//
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
|
||||
@@ -25,10 +30,10 @@ export const get3dWidgetInput = async (chartId: string, organization: string, pr
|
||||
throw new Error("Failed to fetch zoneDatas");
|
||||
}
|
||||
const result = await response.json();
|
||||
console.log('result: ', result);
|
||||
|
||||
return result;
|
||||
} catch (error: any) {
|
||||
echo.error("Failed to fetch 2d widget data");
|
||||
console.log(error.message);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user