issues
search
UNLV-CS472-672
/
2024-S-GROUP5-Munch
The Munch app is a social platform where users create profiles by selecting preferred foods.
1
stars
11
forks
source link
GET and PATCH Recipe routes
#80
Closed
Fabrizv
closed
6 months ago
Fabrizv
commented
6 months ago
Description / Changes Made
Implemented the routes for getting and updating recipe posts.
When getting a recipe route, it uses the recipe_id passed in to contain that specific recipe.
When updating a recipe route, it uses the recipe_id passed in to update that specific recipe
Testing has been moved over to the Firebase Emulator.
Portions of this code that utilized AI generation
n/a
Screenshots (optional)
Getting a recipe
Updating a recipe
How to Test
Comment out @app.before_request in the server.py file. We do not need to run the middleware function while testing.
Run the Firebase Emulator.
Run the python server.py.
Using Postman, use the appropriate route to the Emulator.
When getting a recipe post: Set method to GET, set route and add the recipe id you want to get like
http://127.0.0.1:5000/api/recipes/{instert_recipe_id_here
}.
Check with the Firestore Emulator that the post has been created.
When updating a recipe post: Set method to PATCH, and set route to an existing recipe
http://127.0.0.1:5000/api/recipes/{instert_recipe_id_here
}, and add the newly updated JSON body to input.
Check with the Firestore Emulator that the post has been updated from the database.
The route from the screenshots above is
http://127.0.0.1:5000/api/recipes/8JgOnxlpHszEL5XpkUTZ
Checklist
[x] I have added/updated relevant documentation, and I have followed the coding style guidelines.
[x] I have verified routes are functioning properly
[x] I have checked for any potential conflicts with other branches and fixed any merge conflicts.
Description / Changes Made
Portions of this code that utilized AI generation
Screenshots (optional)
Getting a recipe
Updating a recipe
How to Test
Checklist