diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/ObjectView.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/components/ObjectView.js b/src/components/ObjectView.js index e6556c1..fc761ad 100644 --- a/src/components/ObjectView.js +++ b/src/components/ObjectView.js @@ -17,7 +17,7 @@ class ObjectView extends React.Component { } getData() { - fetch("http://localhost:8000/sc/v0/get", { + fetch(`http://localhost:8000/sc/v0/get/${this.props.id}`, { headers: { Authorization: "Basic " + btoa("user1:pw1") } @@ -29,8 +29,6 @@ class ObjectView extends React.Component { throw `soc_collector responded: ${resp.status}`; return resp.data; }) - // TODO: Proper API call to get single object - .then(data => data.filter(x => x._id == this.props.id)[0]) .then(object => this.setState({ object: object })) .catch(e => this.props.setError(e)); } |
