Add WIP details API
This commit is contained in:
parent
5a20130c37
commit
a57f8170e7
|
@ -48,3 +48,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 })
|
||||
|
|
Loading…
Reference in New Issue
Block a user