Skip to content

Commit

Permalink
fix(api): Use correct API URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridostal committed Oct 18, 2018
1 parent 31942e8 commit 5f32901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Helpers/APIHelper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
let BASE_ROUTE = '/api/v1';

export function createApiCall(endpoint, method, data = undefined) {
return fetch('https://localhost:8300' + endpoint, {
return fetch('https://localhost:8300' + BASE_ROUTE + endpoint, {
method,
body: JSON.stringify(data)
}).then(function(res) {
Expand Down
6 changes: 4 additions & 2 deletions src/Helpers/CVE/CVEHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ export function getVMaaSCVEs(apiProps) {
}

export function getCveDetails(synopsis) {
let result = createApiCall('/api/v1/cves/details/' + synopsis, 'get');
let endpoint = '/cves/' + synopsis + '/details/';
let result = createApiCall(endpoint, 'get');
return result;
}

export function getAffectedSystemsByCVE(synopsis) {
let result = createApiCall('/api/v1/cves/affectedsystems/' + synopsis, 'get');
let endpoint = '/cves/' + synopsis + '/affectedsystems/';
let result = createApiCall(endpoint, 'get');
return result;
}

Expand Down

0 comments on commit 5f32901

Please sign in to comment.