1010@jwt_required ()
1111def favorite_recipe ():
1212 current_user = get_jwt_identity ()
13- recipe_id = request .args .get ("recipe_id" )
13+ recipe_id = request .json .get ("recipe_id" )
1414
1515 db = get_db_connection ()
1616 with db .cursor () as cursor :
@@ -25,7 +25,7 @@ def favorite_recipe():
2525@jwt_required ()
2626def unfavorite_recipe ():
2727 current_user = get_jwt_identity ()
28- recipe_id = request .args .get ("recipe_id" )
28+ recipe_id = request .json .get ("recipe_id" )
2929
3030 db = get_db_connection ()
3131 with db .cursor () as cursor :
@@ -40,7 +40,7 @@ def unfavorite_recipe():
4040@jwt_required ()
4141def rate_recipe ():
4242 current_user = get_jwt_identity ()
43- recipe_id = request .args .get ("recipe_id" )
43+ recipe_id = request .json .get ("recipe_id" )
4444 rating = request .json .get ("rating" )
4545
4646 db = get_db_connection ()
@@ -56,7 +56,7 @@ def rate_recipe():
5656@jwt_required ()
5757def comment_recipe ():
5858 current_user = get_jwt_identity ()
59- recipe_id = request .args .get ("recipe_id" )
59+ recipe_id = request .json .get ("recipe_id" )
6060 comment = request .json .get ("comment" )
6161
6262 db = get_db_connection ()
@@ -71,7 +71,7 @@ def comment_recipe():
7171@interactions_blueprint .route ("/comment" , methods = ["DELETE" ])
7272@jwt_required ()
7373def delete_comment ():
74- comment_id = request .args .get ("comment_id" )
74+ comment_id = request .json .get ("comment_id" )
7575
7676 # TODO: Load the comment first to verify that the user is the author
7777
@@ -88,7 +88,7 @@ def delete_comment():
8888@jwt_required ()
8989def like_comment ():
9090 current_user = get_jwt_identity ()
91- comment_id = request .args .get ("comment_id" )
91+ comment_id = request .json .get ("comment_id" )
9292
9393 db = get_db_connection ()
9494 with db .cursor () as cursor :
@@ -103,7 +103,7 @@ def like_comment():
103103@jwt_required ()
104104def unlike_comment ():
105105 current_user = get_jwt_identity ()
106- comment_id = request .args .get ("comment_id" )
106+ comment_id = request .json .get ("comment_id" )
107107
108108 db = get_db_connection ()
109109 with db .cursor () as cursor :
0 commit comments