Skip to content

Commit

Permalink
Make a doRequest instead of fetch.
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl committed Mar 24, 2017
1 parent 32988c0 commit ddb6534
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions client/app/scripts/utils/web-api-utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import debug from 'debug';
import reqwest from 'reqwest';
import trimStart from 'lodash/trimStart';
import defaults from 'lodash/defaults';
import { Map as makeMap } from 'immutable';

Expand Down Expand Up @@ -167,11 +166,8 @@ function getNodesForTopologies(getState, dispatch, topologyIds, topologyOptions
.filter((_, topologyId) => topologyIds.contains(topologyId))
.reduce((sequence, topologyUrl, topologyId) => sequence.then(() => {
const optionsQuery = buildOptionsQuery(topologyOptions.get(topologyId));
// Trim the leading slash from the url before requesting.
// This ensures that scope will request from the correct route if embedded in an iframe.
return fetch(`${trimStart(topologyUrl, '/')}?${optionsQuery}`);
return doRequest({ url: `${getApiPath()}${topologyUrl}?${optionsQuery}` });
})
.then(response => response.json())
.then(json => dispatch(receiveNodesForTopology(json.nodes, topologyId))),
Promise.resolve());
}
Expand Down

0 comments on commit ddb6534

Please sign in to comment.