Compare commits

...

3 Commits

Author SHA1 Message Date
4448de1288 Remove matt's files 2020-05-12 17:36:04 -07:00
910bb5d5bf Merge branch 'master' of https://dev.danilafe.com/CS-46X/server 2020-05-12 17:33:11 -07:00
a57f8170e7 Add WIP details API 2020-05-12 17:32:47 -07:00
9 changed files with 8 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -72,3 +72,11 @@ def collar_history(id):
order_by(DataPoint.datetime.desc()).\
all()
return jsonify([point.to_dict() for point in data_points])
@app.route('/collars/<int:id>/details')
@jwt_required
def collar_detail(id):
collar = Collar.query.filter_by(id=id).first()
if collar is None: abort(404)
return jsonify({'id': collar.id, 'name': collar.name })