feat: Implement wall asset management APIs and socket integration for create, update, and delete operations
This commit is contained in:
@@ -7,6 +7,7 @@ import { useParams } from 'react-router-dom';
|
||||
import useModuleStore from '../../../store/useModuleStore';
|
||||
import WallAssetCreator from './wallAssetCreator'
|
||||
import WallAssetInstances from './Instances/wallAssetInstances'
|
||||
import { getWallAssetsApi } from '../../../services/factoryBuilder/asset/wallAsset/getWallAssetsApi';
|
||||
|
||||
function WallAssetGroup() {
|
||||
const { togglView } = useToggleView();
|
||||
@@ -26,6 +27,21 @@ function WallAssetGroup() {
|
||||
setDeletableWallAsset(null);
|
||||
}, [togglView, activeModule, activeTool])
|
||||
|
||||
useEffect(() => {
|
||||
if (projectId && selectedVersion) {
|
||||
getWallAssetsApi(projectId, selectedVersion?.versionId || '').then((wallAssets) => {
|
||||
console.log('wallAssets: ', wallAssets);
|
||||
if (wallAssets && wallAssets.length > 0) {
|
||||
setWallAssets(wallAssets);
|
||||
} else {
|
||||
setWallAssets([]);
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
}, [projectId, selectedVersion?.versionId])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user