From 5937fe84dee22b5418c75862c00c33607a8b9016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Flatval?= Date: Fri, 4 Aug 2023 14:57:28 +0200 Subject: [PATCH] feat: only make 4 requests instead of 5, return node ex-ID only --- .../src/components/Reveal3DResources/queryMappedData.ts | 8 +------- .../src/components/Reveal3DResources/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/react-components/src/components/Reveal3DResources/queryMappedData.ts b/react-components/src/components/Reveal3DResources/queryMappedData.ts index c92f8ecd387..ebfb6b58e18 100644 --- a/react-components/src/components/Reveal3DResources/queryMappedData.ts +++ b/react-components/src/components/Reveal3DResources/queryMappedData.ts @@ -63,14 +63,8 @@ export async function queryMappedData( const dataView = inspectionResult.items[0]?.inspectionResults.involvedViewsAndContainers?.views[0]; - const nodeData = await filterNodeData(fdmClient, dataNode, dataView); - - if (nodeData === undefined) { - return undefined; - } - return { - data: nodeData, + nodeExternalId: dataNode.externalId, view: dataView, cadNode: selectedNode, intersection: cadIntersection diff --git a/react-components/src/components/Reveal3DResources/types.ts b/react-components/src/components/Reveal3DResources/types.ts index 63d4875a396..563e5600a03 100644 --- a/react-components/src/components/Reveal3DResources/types.ts +++ b/react-components/src/components/Reveal3DResources/types.ts @@ -8,7 +8,7 @@ import { type CadIntersection } from '@cognite/reveal'; import { type Matrix4 } from 'three'; -import { type FdmNode, type Source } from '../../utilities/FdmSDK'; +import { type Source } from '../../utilities/FdmSDK'; import { type Node3D } from '@cognite/sdk/dist/src'; export type AddImageCollection360Options = { @@ -23,7 +23,7 @@ export type AddReveal3DModelOptions = AddModelOptions & { transform?: Matrix4 }; export type TypedReveal3DModel = AddReveal3DModelOptions & { type: SupportedModelTypes | '' }; export type NodeDataResult = { - data: FdmNode; + nodeExternalId: string; view: Source; cadNode: Node3D; intersection: CadIntersection;