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

Modify Cloud Firestore Posts to Follow New Schema #35

Closed rparker2003 closed 5 months ago

rparker2003 commented 5 months ago

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.:

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.