File tree 3 files changed +6
-10
lines changed
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';
9
9
export { configureStore , rootReducer } from './store' ;
10
10
export { default as appRoutes } from './routes' ;
11
11
12
- export { createApi , YdbEmbeddedAPI } from './services/api' ;
12
+ export { YdbEmbeddedAPI } from './services/api' ;
13
13
export { settingsManager } from './services/settings' ;
14
14
export { getUserSettings } from './containers/UserSettings/settings' ;
15
15
export { setSettingValue , getSettingValue } from './store/reducers/settings/settings' ;
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ export class YdbEmbeddedAPI {
25
25
meta ?: MetaAPI ;
26
26
codeAssist ?: CodeAssistAPI ;
27
27
28
- constructor ( { config, webVersion} : { config : AxiosRequestConfig ; webVersion ?: boolean } ) {
28
+ constructor ( { webVersion = false , withCredentials = false } = { } ) {
29
+ const config : AxiosRequestConfig = { withCredentials} ;
30
+
29
31
this . auth = new AuthAPI ( { config} ) ;
30
32
if ( webVersion ) {
31
33
this . meta = new MetaAPI ( { config} ) ;
@@ -41,9 +43,3 @@ export class YdbEmbeddedAPI {
41
43
this . viewer = new ViewerAPI ( { config} ) ;
42
44
}
43
45
}
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';
4
4
import { createBrowserHistory } from 'history' ;
5
5
import { listenForHistoryChange } from 'redux-location-state' ;
6
6
7
- import { createApi } from '../services/api' ;
7
+ import { YdbEmbeddedAPI } from '../services/api' ;
8
8
9
9
import { getUrlData } from './getUrlData' ;
10
10
import rootReducer from './reducers' ;
@@ -57,7 +57,7 @@ const isSingleClusterMode = `${metaBackend}` === 'undefined';
57
57
export function configureStore ( {
58
58
aRootReducer = rootReducer ,
59
59
singleClusterMode = isSingleClusterMode ,
60
- api = createApi ( { webVersion, withCredentials : ! customBackend } ) ,
60
+ api = new YdbEmbeddedAPI ( { webVersion, withCredentials : ! customBackend } ) ,
61
61
} = { } ) {
62
62
( { backend, basename, clusterName} = getUrlData ( {
63
63
href : window . location . href ,
You can’t perform that action at this time.
0 commit comments