Skip to content

Commit

Permalink
- [dashboard/ci] use rebased and updated branch origin/feature/benchm…
Browse files Browse the repository at this point in the history
…ark_webapi_rebased for orion backend

- [dashboard/src] Get back to Axios only
  • Loading branch information
notoraptor committed Jun 28, 2022
1 parent 152889a commit 0c034be
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dashboard-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- run: python -m pip install git+https://github.com/notoraptor/orion.git@feature/benchmark_webapi#egg=orion[profet]
- run: python -m pip install git+https://github.com/notoraptor/orion.git@feature/benchmark_webapi_rebased#egg=orion[profet]
- run: |
# Launch backend in repository root
cd ../../
Expand Down
26 changes: 0 additions & 26 deletions dashboard/src/src/utils/makeRESTCallAxios.js

This file was deleted.

33 changes: 0 additions & 33 deletions dashboard/src/src/utils/makeRESTCallHTTP.js

This file was deleted.

27 changes: 26 additions & 1 deletion dashboard/src/src/utils/queryServer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
import { makeRESTCallAxios as makeRESTCall } from './makeRESTCallAxios';
import axios from 'axios';
// Use adapter to prevent "cross origin forbidden" error in tests
// Ref (2022/02/01): https://github.com/axios/axios/issues/1418
import adapter from 'axios/lib/adapters/http';

/**
* Make a REST call using GET method and axios module.
* @param {string} path - address to load
* @param {Object} parameters - GET parameters
* @param resolve - function to call on success. Will receive JSON data.
* @param reject - function to call on error. Will receive raw error object.
*/
function makeRESTCall(path, parameters, resolve, reject) {
const config = {
method: 'get',
url: path,
responseType: 'json',
responseEncoding: 'utf8',
adapter: adapter,
timeout: 300000,
};
if (Object.keys(parameters).length) config.params = parameters;
axios(config)
.then(response => resolve(response.data))
.catch(reject);
}

/** Wrapper class to call Orion Web API. */
export class Backend {
Expand Down

0 comments on commit 0c034be

Please sign in to comment.