Commit 5be91500 authored by Willard's avatar Willard

Add endpoint for getting all dishes

parent 34768301
...@@ -41,6 +41,14 @@ def search(): ...@@ -41,6 +41,14 @@ def search():
return jsonify(data) return jsonify(data)
@app.route('/api/dishes')
def all_dishes():
data = []
dishes = Dish.query.all()
for dish in dishes:
data.append(dish_obj(dish))
return jsonify(data)
@app.route('/api/users/new', methods=['POST']) @app.route('/api/users/new', methods=['POST'])
def new_user(): def new_user():
result = {'success': True, 'field': ''} result = {'success': True, 'field': ''}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment