Merge branch 'main-dev' into dev-refactor
This commit is contained in:
@@ -19,7 +19,7 @@ export const createProject = async (projectUuid: string, userId: string, thumbna
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add project");
|
||||
console.error("Failed to add project");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -28,7 +28,7 @@ export const deleteProject = async (
|
||||
}
|
||||
console.log("response: ", response);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to clearPanel in the zone");
|
||||
console.error("Failed to clearPanel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -23,13 +23,13 @@ export const deleteTrash = async (organization: string, projectId: string) => {
|
||||
console.log("restore: ", response);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch trash data");
|
||||
console.error("Failed to fetch trash data");
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error: any) {
|
||||
console.error("Failed to fetch trash data:", error);
|
||||
throw new Error(error.message || "Unknown error");
|
||||
console.error(error.message || "Unknown error");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ export const duplicateProject = async (
|
||||
}
|
||||
// console.log("response: ", response);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add project");
|
||||
console.error("Failed to add project");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,13 +22,13 @@ export const getTrash = async (organization: string) => {
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch trash data");
|
||||
console.error("Failed to fetch trash data");
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error: any) {
|
||||
console.error("Failed to fetch trash data:", error);
|
||||
throw new Error(error.message || "Unknown error");
|
||||
console.error(error.message || "Unknown error");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ export const projectTutorial = async () => {
|
||||
// console.log("response: ", response);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add project");
|
||||
console.error("Failed to add project");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -20,7 +20,7 @@ export const recentlyViewed = async (organization: string, userId: string) => {
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch project");
|
||||
console.error("Failed to fetch project");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const restoreTrash = async (organization: string, projectId: string) => {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch trash data");
|
||||
console.error("Failed to fetch trash data");
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
@@ -30,6 +30,6 @@ export const restoreTrash = async (organization: string, projectId: string) => {
|
||||
return data;
|
||||
} catch (error: any) {
|
||||
console.error("Failed to fetch trash data:", error);
|
||||
throw new Error(error.message || "Unknown error");
|
||||
console.error(error.message || "Unknown error");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ export const searchProject = async (
|
||||
|
||||
console.log("response: ", response);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to Search project");
|
||||
console.error("Failed to Search project");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -24,7 +24,7 @@ export const trashSearchProject = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add project");
|
||||
console.error("Failed to add project");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -37,7 +37,7 @@ export const updateProject = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to clearPanel in the zone");
|
||||
console.error("Failed to clearPanel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -25,7 +25,7 @@ export const viewProject = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch");
|
||||
console.error("Failed to fetch");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -25,7 +25,7 @@ export const createAisleApi = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add project");
|
||||
console.error("Failed to add project");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -18,7 +18,7 @@ export const deleteAisleApi = async (aisleUuid: string, projectId: string, versi
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to clearPanel in the zone");
|
||||
console.error("Failed to clearPanel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const getAisleApi = async (projectId: string, versionId: string) => {
|
||||
|
||||
// console.log("response: ", response);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch");
|
||||
console.error("Failed to fetch");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -13,7 +13,7 @@ export const getAssetImages = async (cursor?: string) => {
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch assets");
|
||||
console.error("Failed to fetch assets");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -13,7 +13,7 @@ export const getAssetModel = async (modelId: string) => {
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch model");
|
||||
console.error("Failed to fetch model");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -26,7 +26,7 @@ export const deleteFloorItem = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete Floor Item");
|
||||
console.error("Failed to delete Floor Item");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const getFloorAssets = async (organization: string, projectId?: string, v
|
||||
|
||||
// console.log('response: ', response);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get assets");
|
||||
console.error("Failed to get assets");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -18,7 +18,7 @@ export const setAssetsApi = async (data: any) => {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to set or update Floor Item");
|
||||
console.error("Failed to set or update Floor Item");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -26,7 +26,7 @@ export const deleteWallItem = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete Wall Item");
|
||||
console.error("Failed to delete Wall Item");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getWallItems = async (organization: string, projectId?: string, ver
|
||||
}
|
||||
// console.log('response: ', response);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get Wall Items");
|
||||
console.error("Failed to get Wall Items");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -39,7 +39,7 @@ export const setWallItem = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to set or update Wall Item");
|
||||
console.error("Failed to set or update Wall Item");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getCamera = async (organization: string, userId: string, projectId?
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get Camera position and target");
|
||||
console.error("Failed to get Camera position and target");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -31,7 +31,7 @@ export const setCamera = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to set Camera Position and Target");
|
||||
console.error("Failed to set Camera Position and Target");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -21,11 +21,11 @@ export default async function getActiveUsersData(organization: string) {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Error: ${response.status} - ${response.statusText}`);
|
||||
console.error(`Error: ${response.status} - ${response.statusText}`);
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get active cameras ");
|
||||
console.error("Failed to get active cameras ");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -20,11 +20,11 @@ export default async function fetchShareUsers(organization: string) {
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error(`Error: ${response.status} - ${response.statusText}`);
|
||||
console.error(`Error: ${response.status} - ${response.statusText}`);
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get users ");
|
||||
console.error("Failed to get users ");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -23,7 +23,7 @@ export default async function giveCollabAccess(
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to set Camera Position and Target");
|
||||
console.error("Failed to set Camera Position and Target");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -4,18 +4,20 @@ export const addCommentsApi = async (
|
||||
projectId: any,
|
||||
comment: string,
|
||||
threadId?: string,
|
||||
commentId?: string
|
||||
commentId?: string,
|
||||
versionId?: string
|
||||
) => {
|
||||
console.log(
|
||||
" projectId, comments, threadId: ",
|
||||
projectId,
|
||||
comment,
|
||||
threadId,
|
||||
commentId
|
||||
commentId,
|
||||
versionId
|
||||
);
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${url_Backend_dwinzo}/api/v1/Thread/addComment`,
|
||||
`${url_Backend_dwinzo}/api/V1/Thread/addComment`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -33,9 +35,9 @@ export const addCommentsApi = async (
|
||||
//console.log("New token received:", newAccessToken);
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
console.log('response: ', response);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add project");
|
||||
console.error("Failed to add project");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
@@ -44,9 +46,9 @@ export const addCommentsApi = async (
|
||||
return result;
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
console.error(error.message);
|
||||
} else {
|
||||
throw new Error("An unknown error occurred");
|
||||
console.error("An unknown error occurred");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,10 +5,11 @@ export const createThreadApi = async (
|
||||
state: string,
|
||||
position: any,
|
||||
rotation: any,
|
||||
threadTitle: any
|
||||
threadTitle: any,
|
||||
versionId?: string
|
||||
) => {
|
||||
try {
|
||||
const response = await fetch(`${url_Backend_dwinzo}/api/v1/upsetThread`, {
|
||||
const response = await fetch(`${url_Backend_dwinzo}/api/V1/upsetThread`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: "Bearer <access_token>",
|
||||
@@ -16,7 +17,14 @@ export const createThreadApi = async (
|
||||
token: localStorage.getItem("token") || "",
|
||||
refresh_token: localStorage.getItem("refreshToken") || "",
|
||||
},
|
||||
body: JSON.stringify({ projectId, state, position, rotation, threadTitle }),
|
||||
body: JSON.stringify({
|
||||
projectId,
|
||||
state,
|
||||
position,
|
||||
rotation,
|
||||
threadTitle,
|
||||
versionId,
|
||||
}),
|
||||
});
|
||||
const newAccessToken = response.headers.get("x-access-token");
|
||||
if (newAccessToken) {
|
||||
@@ -24,16 +32,16 @@ export const createThreadApi = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add project");
|
||||
console.error("Failed to add project");
|
||||
}
|
||||
const result = await response.json();
|
||||
console.log('result: ', result);
|
||||
console.log("result: ", result);
|
||||
return result;
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
console.error(error.message);
|
||||
} else {
|
||||
throw new Error("An unknown error occurred");
|
||||
console.error("An unknown error occurred");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,17 +4,19 @@ let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_UR
|
||||
export const deleteCommentApi = async (
|
||||
projectId: string,
|
||||
threadId: string,
|
||||
commentId: string
|
||||
commentId: string,
|
||||
versionId?: string
|
||||
) => {
|
||||
const body: any = {
|
||||
projectId,
|
||||
threadId,
|
||||
commentId,
|
||||
versionId,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${url_Backend_dwinzo}/api/v1/Thread/deleteComment`,
|
||||
`${url_Backend_dwinzo}/api/V1/Thread/deleteComment`,
|
||||
{
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
@@ -32,16 +34,16 @@ export const deleteCommentApi = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to clearPanel in the zone");
|
||||
console.error("Failed to clearPanel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
return result;
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
console.error(error.message);
|
||||
} else {
|
||||
throw new Error("An unknown error occurred");
|
||||
console.error("An unknown error occurred");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
|
||||
// let url_Backend_dwinzo = `http://192.168.0.102:5000`;
|
||||
|
||||
export const deleteThreadApi = async (projectId: string, threadId: string) => {
|
||||
export const deleteThreadApi = async (
|
||||
projectId: string,
|
||||
threadId: string,
|
||||
versionId: string
|
||||
) => {
|
||||
const body: any = {
|
||||
projectId,
|
||||
threadId,
|
||||
versionId,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch(`${url_Backend_dwinzo}/api/v1/Thread/delete`, {
|
||||
const response = await fetch(`${url_Backend_dwinzo}/api/V1/Thread/delete`, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
Authorization: "Bearer <access_token>",
|
||||
@@ -24,16 +29,16 @@ export const deleteThreadApi = async (projectId: string, threadId: string) => {
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to clearPanel in the zone");
|
||||
console.error("Failed to clearPanel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
return result;
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
console.error(error.message);
|
||||
} else {
|
||||
throw new Error("An unknown error occurred");
|
||||
console.error("An unknown error occurred");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,17 +4,19 @@ let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_UR
|
||||
export const editThreadTitleApi = async (
|
||||
projectId: string,
|
||||
threadId: string,
|
||||
threadTitle: string
|
||||
threadTitle: string,
|
||||
versionId?: string
|
||||
) => {
|
||||
const body: any = {
|
||||
projectId,
|
||||
threadId,
|
||||
threadTitle,
|
||||
versionId,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${url_Backend_dwinzo}/api/v1/Thread/updateTitle`,
|
||||
`${url_Backend_dwinzo}/api/V1/Thread/updateTitle`,
|
||||
{
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
@@ -32,16 +34,16 @@ export const editThreadTitleApi = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to clearPanel in the zone");
|
||||
console.error("Failed to clearPanel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
return result;
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
console.error(error.message);
|
||||
} else {
|
||||
throw new Error("An unknown error occurred");
|
||||
console.error("An unknown error occurred");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
|
||||
|
||||
export const getAllThreads = async (projectId: string) => {
|
||||
export const getAllThreads = async (projectId: string, versionId: string) => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${url_Backend_dwinzo}/api/v1/Threads/${projectId}`,
|
||||
`${url_Backend_dwinzo}/api/V1/Threads/${projectId}/${versionId}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -21,19 +21,19 @@ export const getAllThreads = async (projectId: string) => {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get assets");
|
||||
console.error("Failed to get assets");
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
// console.log('result: ', result);
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
echo.error("Failed to get floor asset");
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
console.error(error.message);
|
||||
} else {
|
||||
throw new Error("An unknown error occurred");
|
||||
console.error("An unknown error occurred");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ export const findEnvironment = async (organization: string, userId: string, proj
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get wall and roof visibility");
|
||||
console.error("Failed to get wall and roof visibility");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -41,7 +41,7 @@ export const setEnvironment = async (
|
||||
}
|
||||
// console.log('responseenv: ', response);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to set wall and roof visibility");
|
||||
console.error("Failed to set wall and roof visibility");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -18,7 +18,7 @@ export const deleteLayer = async (organization: string, layer: number) => {
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete line");
|
||||
console.error("Failed to delete line");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -18,7 +18,7 @@ export const deleteLineApi = async (organization: string, line: Object) => {
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete line");
|
||||
console.error("Failed to delete line");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -19,7 +19,7 @@ export const deletePointApi = async (organization: string, uuid: string) => {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete point");
|
||||
console.error("Failed to delete point");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getLines = async (organization: string, projectId?: string, version
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get Lines");
|
||||
console.error("Failed to get Lines");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -25,7 +25,7 @@ export const setLine = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to set line");
|
||||
console.error("Failed to set line");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const updatePoint = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to update point");
|
||||
console.error("Failed to update point");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -14,7 +14,7 @@ export const signUpApi = async (
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to signUpApi");
|
||||
console.error("Failed to signUpApi");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -28,7 +28,7 @@ export const createVersionApi = async (projectId: string, createdBy: string, hie
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to create Version History");
|
||||
console.error("Failed to create Version History");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getVersionDataApi = async (projectId: string, versionId: string) =>
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get Version Data");
|
||||
console.error("Failed to get Version Data");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getVersionHistoryApi = async (projectId: string, page?: number, lim
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get Version History");
|
||||
console.error("Failed to get Version History");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const deleteZonesApi = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete zone");
|
||||
console.error("Failed to delete zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const getZonesApi = async (organization: string, projectId?: string, vers
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to get Zones");
|
||||
console.error("Failed to get Zones");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const setZonesApi = async (
|
||||
localStorage.setItem("token", newAccessToken);
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to set zone");
|
||||
console.error("Failed to set zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -11,7 +11,7 @@ export const getAssetDetails = async (filename: string) => {
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch asset details");
|
||||
console.error("Failed to fetch asset details");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -3,7 +3,7 @@ export const fetchAssets = async () => {
|
||||
try {
|
||||
const response = await fetch(`${BackEnd_url}/api/v1/getAllAssets`);
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
console.error("Network response was not ok");
|
||||
}
|
||||
const result = await response.json();
|
||||
// const last10Assets = result.slice(-10);
|
||||
|
||||
@@ -13,7 +13,7 @@ export const fetchGltfUrl = async (filename: string, AssetID: string) => {
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch asset details");
|
||||
console.error("Failed to fetch asset details");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -12,7 +12,7 @@ export const getSortedAssets = async (category: any, orders: any) => {
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Error: ${response.statusText}`);
|
||||
console.error(`Error: ${response.statusText}`);
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const upsertProductOrEventApi = async (body: any) => {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add product or event");
|
||||
console.error("Failed to add product or event");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -24,7 +24,7 @@ export const deleteEventDataApi = async (body: any) => {
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete event data");
|
||||
console.error("Failed to delete event data");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const deleteProductApi = async (body: any) => {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete product data");
|
||||
console.error("Failed to delete product data");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -24,7 +24,7 @@ export const getProductApi = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch product data");
|
||||
console.error("Failed to fetch product data");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getAllProductsApi = async (projectId: string, versionId: string) =>
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch all products data");
|
||||
console.error("Failed to fetch all products data");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -24,7 +24,7 @@ export const renameProductApi = async (body: {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to rename product");
|
||||
console.error("Failed to rename product");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -28,7 +28,7 @@ export const adding3dWidgets = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add 3dwidget in the zone");
|
||||
console.error("Failed to add 3dwidget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const addingFloatingWidgets = async (zoneUuid: string,organization: strin
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add Floatingwidget in the zone");
|
||||
console.error("Failed to add Floatingwidget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -27,7 +27,7 @@ export const addingWidgets = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add widget in the zone");
|
||||
console.error("Failed to add widget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -25,7 +25,7 @@ export const clearPanel = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to clearPanel in the zone");
|
||||
console.error("Failed to clearPanel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -29,7 +29,7 @@ export const delete3dWidgetApi = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete floating widget in the zone");
|
||||
console.error("Failed to delete floating widget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -27,7 +27,7 @@ export const deleteFloatingWidgetApi = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete floating widget in the zone");
|
||||
console.error("Failed to delete floating widget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -26,7 +26,7 @@ export const deletePanelApi = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete widget in the zone");
|
||||
console.error("Failed to delete widget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -25,7 +25,7 @@ export const deleteTemplateApi = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete template ");
|
||||
console.error("Failed to delete template ");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -25,7 +25,7 @@ export const deleteWidgetApi = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to delete widget in the zone");
|
||||
console.error("Failed to delete widget in the zone");
|
||||
}
|
||||
const result = await response.json();
|
||||
return result;
|
||||
|
||||
@@ -23,7 +23,7 @@ export const duplicateWidgetApi = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to duplicate widget in the zone");
|
||||
console.error("Failed to duplicate widget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -27,7 +27,7 @@ export const get3dWidgetZoneData = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch Zone3dWidgetData");
|
||||
console.error("Failed to fetch Zone3dWidgetData");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -27,7 +27,7 @@ export const getFloatingZoneData = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch ZoneFloatingData");
|
||||
console.error("Failed to fetch ZoneFloatingData");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -21,7 +21,7 @@ export const getSelect2dZoneData = async (zoneUuid?: string, organization?: stri
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch zoneDatas");
|
||||
console.error("Failed to fetch zoneDatas");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const getTemplateData = async (organization?: string, projectId?: string,
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch ZoneFloatingData");
|
||||
console.error("Failed to fetch ZoneFloatingData");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -23,7 +23,7 @@ export const getZoneData = async (zoneUuid: string, organization: string, projec
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch zoneData");
|
||||
console.error("Failed to fetch zoneData");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -27,7 +27,7 @@ export const loadTempleteApi = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load Template in the zone");
|
||||
console.error("Failed to load Template in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -24,7 +24,7 @@ export const lockPanel = async (
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to Lock Panel in the zone");
|
||||
console.error("Failed to Lock Panel in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -24,7 +24,7 @@ export const panelData = async (
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add panelOrder for Zone");
|
||||
console.error("Failed to add panelOrder for Zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -20,7 +20,7 @@ export const saveTemplateApi = async (organization: string, template: {}) => {
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to save template zone");
|
||||
console.error("Failed to save template zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -35,7 +35,7 @@ export const update3dWidget = async (
|
||||
|
||||
if (!response.ok) {
|
||||
echo.error("Failed to update 3d widget");
|
||||
throw new Error("Failed to add 3dwidget in the zone");
|
||||
console.error("Failed to add 3dwidget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
@@ -76,7 +76,7 @@ export const update3dWidgetRotation = async (
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to add 3dwidget in the zone");
|
||||
console.error("Failed to add 3dwidget in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
@@ -22,7 +22,7 @@ export const zoneCameraUpdate = async (zoneData: {}, organization: string, proje
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to update camera position in the zone");
|
||||
console.error("Failed to update camera position in the zone");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
Reference in New Issue
Block a user