File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export {AsideNavigation} from './containers/AsideNavigation/AsideNavigation';
99export { configureStore , rootReducer } from './store' ;
1010export { default as appRoutes } from './routes' ;
1111
12- export { createApi , YdbEmbeddedAPI } from './services/api' ;
12+ export { YdbEmbeddedAPI } from './services/api' ;
1313export { settingsManager } from './services/settings' ;
1414export { getUserSettings } from './containers/UserSettings/settings' ;
1515export { setSettingValue , getSettingValue } from './store/reducers/settings/settings' ;
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ export class YdbEmbeddedAPI {
2525 meta ?: MetaAPI ;
2626 codeAssist ?: CodeAssistAPI ;
2727
28- constructor ( { config, webVersion} : { config : AxiosRequestConfig ; webVersion ?: boolean } ) {
28+ constructor ( { webVersion = false , withCredentials = false } = { } ) {
29+ const config : AxiosRequestConfig = { withCredentials} ;
30+
2931 this . auth = new AuthAPI ( { config} ) ;
3032 if ( webVersion ) {
3133 this . meta = new MetaAPI ( { config} ) ;
@@ -41,9 +43,3 @@ export class YdbEmbeddedAPI {
4143 this . viewer = new ViewerAPI ( { config} ) ;
4244 }
4345}
44-
45- export function createApi ( { webVersion = false , withCredentials = false } = { } ) {
46- const config : AxiosRequestConfig = { withCredentials} ;
47- const api = new YdbEmbeddedAPI ( { config, webVersion} ) ;
48- return api ;
49- }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type {History} from 'history';
44import { createBrowserHistory } from 'history' ;
55import { listenForHistoryChange } from 'redux-location-state' ;
66
7- import { createApi } from '../services/api' ;
7+ import { YdbEmbeddedAPI } from '../services/api' ;
88
99import { getUrlData } from './getUrlData' ;
1010import rootReducer from './reducers' ;
@@ -57,7 +57,7 @@ const isSingleClusterMode = `${metaBackend}` === 'undefined';
5757export function configureStore ( {
5858 aRootReducer = rootReducer ,
5959 singleClusterMode = isSingleClusterMode ,
60- api = createApi ( { webVersion, withCredentials : ! customBackend } ) ,
60+ api = new YdbEmbeddedAPI ( { webVersion, withCredentials : ! customBackend } ) ,
6161} = { } ) {
6262 ( { backend, basename, clusterName} = getUrlData ( {
6363 href : window . location . href ,
You can’t perform that action at this time.
0 commit comments