Skip to content

Commit

Permalink
return label path
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Heffer-Shef committed Jun 14, 2024
1 parent c592684 commit b1ee3eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/btviewer/blueprints/label/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create():
labels = flask.request.json

# Create the labels
photo.add_labels(labels, source=source, version=version)
label_path = photo.add_labels(labels, source=source, version=version)

# Return a success response
return flask.Response(status=HTTPStatus.CREATED)
return flask.jsonify(dict(label_path=label_path)), HTTPStatus.CREATED
2 changes: 2 additions & 0 deletions backend/btviewer/blueprints/photo/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def add_labels(self, labels: list[dict], source: str, version: str, indent: int
json.dump(document, file, indent=indent)
app.logger.info("Labels saved to '%s'", file.name)

return file.name

@property
def label_directory(self) -> Path:
"""
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SaveMarkers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function SaveMarkers(props) {
body: JSON.stringify(props.markerList)
})
.then((response) => {
console.log(response);
console.log(JSON.stringify(response.json()));
})
.catch((err) => {
console.log(err.response.data)
Expand Down

0 comments on commit b1ee3eb

Please sign in to comment.