Is your feature request related to a problem? Please describe.
We need to modify the schema of the current 'posts' collection in the database and routes to reflect the changes to the database.
The new Posts schema is as follows:
Field
Type
Description
Author
reference to user id
The author of the post.
Comments
Array
Comments made on the post.
- Author
reference to user id
- Comment
String
- Creation_date
String
Creation Date
String
Date when the post was created.
Description
String
Description of the post.
Likes
number
Number of likes the post has received.
Location
String
Geographical location of the post.
Pictures
Array of strings
Images attached to the post.
The only change is the location field which tracks where the post was created.
Describe the solution you'd like
All routes accessing the posts collection in the database from the 'server.py' file, i.e.:
get_post()
create_post()
update_post()
delete_post()
Need to be modified to follow the new format. This can be done by modifying the validation for each of the routes and returning proper messages.
Testing the changes
The modified routes above must work on the post 'posts/Kr40Rksk4XI4qauBkpYb'. This entry in the posts collection reflects the proper schema and can be used to test the modified routes.
Is your feature request related to a problem? Please describe.
The only change is the location field which tracks where the post was created.
Describe the solution you'd like
All routes accessing the posts collection in the database from the 'server.py' file, i.e.:
Need to be modified to follow the new format. This can be done by modifying the validation for each of the routes and returning proper messages.
Testing the changes
The modified routes above must work on the post 'posts/Kr40Rksk4XI4qauBkpYb'. This entry in the posts collection reflects the proper schema and can be used to test the modified routes.