Skip to content

Commit

Permalink
feat: only make 4 requests instead of 5, return node ex-ID only
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite committed Aug 4, 2023
1 parent 5cec685 commit 68295c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,8 @@ export async function queryMappedData<NodeType>(
const dataView =
inspectionResult.items[0]?.inspectionResults.involvedViewsAndContainers?.views[0];

const nodeData = await filterNodeData<NodeType>(fdmClient, dataNode, dataView);

if (nodeData === undefined) {
return undefined;
}

return {
data: nodeData,
nodeExternalId: dataNode.externalId,
view: dataView,
cadNode: selectedNode,
intersection: cadIntersection
Expand Down
4 changes: 2 additions & 2 deletions react-components/src/components/Reveal3DResources/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -23,7 +23,7 @@ export type AddReveal3DModelOptions = AddModelOptions & { transform?: Matrix4 };
export type TypedReveal3DModel = AddReveal3DModelOptions & { type: SupportedModelTypes | '' };

export type NodeDataResult<NodeType> = {
data: FdmNode<NodeType>;
nodeExternalId: string;
view: Source;
cadNode: Node3D;
intersection: CadIntersection;
Expand Down

0 comments on commit 68295c1

Please sign in to comment.