update assetID
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;
|
||||
|
||||
export const getFloorAssets = async (organization: string,projectId?:string) => {
|
||||
export const getFloorAssets = async (organization: string, projectId?: string) => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${url_Backend_dwinzo}/api/V1/floorAssets/${projectId}`,
|
||||
|
||||
@@ -3,7 +3,8 @@ export const setFloorItemApi = async (
|
||||
organization: string,
|
||||
modelUuid?: string,
|
||||
modelName?: string,
|
||||
modelfileID?: string,
|
||||
assetId?: string,
|
||||
projectId?: string,
|
||||
position?: Object,
|
||||
rotation?: Object,
|
||||
isLocked?: boolean,
|
||||
@@ -14,9 +15,10 @@ export const setFloorItemApi = async (
|
||||
organization,
|
||||
modelUuid,
|
||||
modelName,
|
||||
projectId,
|
||||
position,
|
||||
rotation,
|
||||
modelfileID,
|
||||
assetId,
|
||||
isLocked,
|
||||
isVisible,
|
||||
};
|
||||
|
||||
@@ -21,7 +21,6 @@ export const getWallItems = async (organization: string,projectId?:string) => {
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
// console.log('result: ', result);
|
||||
return result;
|
||||
} catch (error) {
|
||||
echo.error("Failed to get wall items");
|
||||
|
||||
@@ -13,14 +13,14 @@ onmessage = async (event) => {
|
||||
const { floorItems } = event.data;
|
||||
|
||||
const uniqueItems = floorItems.filter((item, index, self) =>
|
||||
index === self.findIndex((t) => t.modelfileID === item.modelfileID)
|
||||
index === self.findIndex((t) => t.assetId === item.assetId)
|
||||
);
|
||||
|
||||
for (const item of uniqueItems) {
|
||||
if(item.modelfileID === null || item.modelfileID === undefined) {
|
||||
continue; // Skip items without a valid modelfileID
|
||||
if(item.assetId === null || item.assetId === undefined) {
|
||||
continue; // Skip items without a valid assetId
|
||||
}
|
||||
const modelID = item.modelfileID;
|
||||
const modelID = item.assetId;
|
||||
const indexedDBModel = await retrieveGLTF(modelID);
|
||||
|
||||
let modelBlob;
|
||||
|
||||
Reference in New Issue
Block a user