File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,13 +171,16 @@ class DatabaseDetail extends PureComponent {
171171 const { projectDetail } = this . props
172172 const { table_names, tables } = projectDetail
173173
174+ const number_of_tables =
175+ ( Object . keys ( tables ) && Object . keys ( tables ) . length ) || 0
176+
174177 return (
175178 < Page inner >
176179 < div className = { styles . tables } >
177180 < div className = { styles . title } >
178181 < Trans > Table Details:</ Trans >
179182 </ div >
180- { Object . keys ( tables ) . length !== 0 ? (
183+ { number_of_tables !== 0 ? (
181184 table_names . map ( name => (
182185 < div key = { name } className = { styles . table } >
183186 < div className = { styles . tableName } >
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ export default {
113113 yield put ( {
114114 type : 'updateState' ,
115115 payload : {
116- userList : data . users ,
116+ userList : data . users || [ ] ,
117117 pagination : {
118118 current : Number ( p . current ) ,
119119 pageSize : Number ( p . pageSize ) ,
@@ -147,6 +147,7 @@ export default {
147147
148148 const { data, success } = yield call ( queryProjectTables , _payload )
149149 if ( success ) {
150+ if ( ! data . tables ) return
150151 yield put ( {
151152 type : 'updateState' ,
152153 payload : {
Original file line number Diff line number Diff line change @@ -73,12 +73,12 @@ class RequestPage extends React.Component {
7373 }
7474
7575 constructAPIDomain = ( ) => {
76- const alias = _get ( this . props . config , [ 'misc ' , 'alias' ] , '' )
77- return '//' + alias + '.stg-api.covenantsql.io:15153'
76+ const api_domain = _get ( this . props . config , [ 'client_api_domains ' , 0 ] )
77+ return '//' + api_domain
7878 }
7979
8080 constructTableSelection = ( ) => {
81- const tables = _get ( this . props . config , [ 'tables' ] , [ ] )
81+ const tables = _get ( this . props . config , [ 'tables' ] ) || [ ]
8282 return (
8383 < Select placeholder = "Select a table" style = { { minWidth : '160px' } } >
8484 { tables . map ( t => {
You can’t perform that action at this time.
0 commit comments