Modified the post's routes to match the format and structure of the current 'posts' collection in the database.
Routes fixed:
get_post
create_post
update_post
delete_post
Fixed post validation function that before returned the wrong string by excluding the first char, subsequently causing the check to fail
Modify get_user_posts route to be more efficient. Rather than iterating over every post in the database and matching it to the user, utilize the posts array inside the user collection itself.
Screenshots
How to Test
Install Postman
Create a collection called 'Munch'
Create a new request
Select the HTTP method for the route you want to test (GET, POST, DELETE, etc)
Add the proper route
Add required data if necessary (JSON data, Content-Type, etc)
Send the request
Check if expected response is received
Check if changes are reflected in the database
Repeat steps 3-11 for any other requests
Checklist
[x] I have added/updated relevant documentation, and I have followed the coding style guidelines.
[x] I have added how to test these additions.
[x] I have checked for any potential conflicts with other branches and fixed any merge conflicts.
This is related to issue #35
Description / Changes Made
Routes fixed:
Fixed post validation function that before returned the wrong string by excluding the first char, subsequently causing the check to fail
Modify get_user_posts route to be more efficient. Rather than iterating over every post in the database and matching it to the user, utilize the posts array inside the user collection itself.
Screenshots
How to Test
Checklist