summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErnst Widerberg <ernstwi@kth.se>2021-10-13 10:06:55 +0200
committerErnst Widerberg <ernstwi@kth.se>2021-10-13 10:06:55 +0200
commit8ee175247bf6e7dc121f33ddd68c60458fed47e9 (patch)
tree5c2d4164d6a44ea049a3855556fc37c1629ee2d7 /src
parent65a5b255d0b3d35ca9908b42f81ed50099308557 (diff)
Use single object API
Diffstat (limited to 'src')
-rw-r--r--src/components/ObjectView.js4
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));
}