Skip to content

Commit d48efbb

Browse files
fix get tables call
1 parent 8969c1c commit d48efbb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/tdb-dashboard/src/hooks/DocumentControlContext.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,14 @@ export const DocumentControlProvider = ({children}) => {
127127
// only if I'm in change request mode
128128
// I do not need to reload because the schema can not change
129129
//if(!currentChangeRequest || documentTablesConfig === null)
130-
getGraphqlTableConfig()
131-
getUpdatedFrames()
132130
// we need in edit/insert
133-
if(id) {
134-
let documentID=decodeUrl(id)
135-
getDocument(documentID)
131+
if(id || changeid) {
132+
getUpdatedFrames()
133+
if(id){
134+
getGraphqlTableConfig()
135+
let documentID=decodeUrl(id)
136+
getDocument(documentID)
137+
}
136138
}
137139
},[id,changeid])
138140

@@ -143,7 +145,8 @@ export const DocumentControlProvider = ({children}) => {
143145
setError(false)
144146
const clientCopy = woqlClient.copy()
145147
clientCopy.connectionConfig.api_extension = 'api/'
146-
const baseUrl = clientCopy.connectionConfig.dbBase("tables")
148+
// const baseUrl = clientCopy.connectionConfig.dbBase("tables")
149+
const baseUrl = clientCopy.connectionConfig.branchBase("tables")
147150
clientCopy.sendCustomRequest("GET", baseUrl).then(result=>{
148151
setDocumentTablesConfig(result)
149152
}).catch(err=>{

0 commit comments

Comments
 (0)