Added all user API

This commit is contained in:
Robbe Van Herck 2018-11-28 14:34:34 +01:00
parent 7f8e6c4a04
commit 0ce0da78d2
No known key found for this signature in database
GPG key ID: 4D1C8E8FBD1C7188

View file

@ -35,3 +35,7 @@ def get_user(id):
@app.route("/users/") @app.route("/users/")
def all_users(): def all_users():
return render_template("allusers.html", data=[user.to_obj() for user in User.query.all()]) return render_template("allusers.html", data=[user.to_obj() for user in User.query.all()])
@app.route("/all")
def all_users_json():
return json.dumps([user.to_obj() for user in User.query.all()])