Commit 9393e66a authored by Willard's avatar Willard

Return JSON in delete endpoints

parent d86601aa
...@@ -166,9 +166,9 @@ def delete_dish_review(dish_id, dish_review_id): ...@@ -166,9 +166,9 @@ def delete_dish_review(dish_id, dish_review_id):
return abort(401) return abort(401)
db.session.delete(review) db.session.delete(review)
db.session.commit() db.session.commit()
return { return jsonify({
'message': 'Review deleted successfully' 'message': 'Review deleted successfully'
}, 200 }), 200
@app.route('/api/dishes/<int:dish_id>/reviews', methods=['GET']) @app.route('/api/dishes/<int:dish_id>/reviews', methods=['GET'])
def dish_reviews(dish_id): def dish_reviews(dish_id):
...@@ -254,9 +254,9 @@ def delete_stall_review(stall_id, stall_review_id): ...@@ -254,9 +254,9 @@ def delete_stall_review(stall_id, stall_review_id):
return abort(401) return abort(401)
db.session.delete(review) db.session.delete(review)
db.session.commit() db.session.commit()
return { return jsonify({
'message': 'Review deleted successfully' 'message': 'Review deleted successfully'
}, 200 }), 200
@app.route('/api/stalls/<int:stall_id>/reviews', methods=['GET']) @app.route('/api/stalls/<int:stall_id>/reviews', methods=['GET'])
def stall_reviews(stall_id): def stall_reviews(stall_id):
......
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