Skip to content

Commit 851ce03

Browse files
committed
fix model builder
1 parent 0ed7073 commit 851ce03

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/tdb-react-components/src/treeGraphComponent/MainGraphObject.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export const MainGraphObject = (mainGraphDataProvider,dbName)=>{
4545
let _rootIndexObj={}
4646

4747
let _descendantsNode=new Map();
48-
49-
let _mainGraphElementsJson={};
48+
// this is an array of objects
49+
let _mainGraphElementsJson=[];
5050

5151
const deleteDocList = []
5252
/*

packages/tdb-react-components/src/treeGraphComponent/hook/modelCallServerHook.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ export const modelCallServerHook = (woqlClient,branch,ref,dbId, pendoMsgAfterCre
2727
const params={"as_list":true,"graph_type":"schema"}
2828
//save with all the context so we can use it for update the schema
2929
jsonSchema = await woqlClient.getDocument(params)
30+
if(!Array.isArray(jsonSchema)){
31+
setResultMainGraph([]);
32+
throw Error(jsonSchema)
33+
}
34+
setResultMainGraph(jsonSchema);
3035
}catch(err){
3136
//tobe review
3237
const message = errorMessageFormatter(err,err.message)
3338
//I have to reset the schema here not in finally
3439
setReport({message:message, status: "error",err: err,time: Date.now() - ts,})
35-
}finally{
36-
setResultMainGraph(jsonSchema);
40+
}finally{
3741
setLoading(false)
3842
}
3943
}

0 commit comments

Comments
 (0)