diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/List.js | 5 | ||||
-rw-r--r-- | src/components/ObjectView.js | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/components/List.js b/src/components/List.js index 69f2a50..0bf359b 100644 --- a/src/components/List.js +++ b/src/components/List.js @@ -54,7 +54,7 @@ class List extends React.Component { getData() { fetch(`${process.env.COLLECTOR_URL}/sc/v0/get?${this.queryString()}`, { headers: { - Authorization: "Basic " + btoa("user1:pw1") + Authorization: "Bearer " + localStorage.getItem("token") } }) // TODO: Look at `status` or return code or both? @@ -70,7 +70,7 @@ class List extends React.Component { if (json.status != "success") throw `Unexpected status from soc_collector: ${json.status}`; this.setState({ - objects: json.data + objects: json.docs }); }) .catch(e => this.props.setError(e)); @@ -95,7 +95,6 @@ class List extends React.Component { setPage(event, value) { this.setState({ page: value }, () => { - console.log(this.state); this.getData(); window.scrollTo(0, 0); }); diff --git a/src/components/ObjectView.js b/src/components/ObjectView.js index 3b39c96..cecadeb 100644 --- a/src/components/ObjectView.js +++ b/src/components/ObjectView.js @@ -19,7 +19,7 @@ class ObjectView extends React.Component { getData() { fetch(`${process.env.COLLECTOR_URL}/sc/v0/get/${this.props.id}`, { headers: { - Authorization: "Basic " + btoa("user1:pw1") + Authorization: "Bearer " + localStorage.getItem("token") } }) // TODO: Look at `status` or return code or both? @@ -35,7 +35,7 @@ class ObjectView extends React.Component { if (json.status != "success") throw `Unexpected status from soc_collector: ${json.status}`; this.setState({ - object: json.data + object: json.docs }); }) .catch(e => this.props.setError(e)); |