Skip to content

Commit

Permalink
Updated apiClient config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sofia Shnaidman committed Nov 18, 2020
1 parent 78e7c56 commit ec4430d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions kafka-ui-react-app/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export const BASE_PARAMS: RequestInit = {
import { ConfigurationParameters } from 'generated-sources';

export const BASE_PARAMS: ConfigurationParameters = {
basePath: process.env.REACT_APP_API_URL,
credentials: 'include',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
},
};

export const BASE_URL = process.env.REACT_APP_API_URL;

export const TOPIC_NAME_VALIDATION_PATTERN = RegExp(/^[.,A-Za-z0-9_-]+$/);

export const MILLISECONDS_IN_WEEK = 604_800_000;
Expand Down
4 changes: 2 additions & 2 deletions kafka-ui-react-app/src/redux/actions/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {
TopicFormDataRaw,
} from 'redux/interfaces';

import { BASE_URL, BASE_PARAMS } from 'lib/constants';
import { BASE_PARAMS } from 'lib/constants';
import * as actions from './actions';

const apiClientConf = new Configuration({ basePath: BASE_URL });
const apiClientConf = new Configuration(BASE_PARAMS);
const apiClient = new ApiClustersApi(apiClientConf);

export const fetchClustersList = (): PromiseThunk<void> => async (dispatch) => {
Expand Down

0 comments on commit ec4430d

Please sign in to comment.