First PR (Linked express router, added backend routes and some test routes, implemented error handling)#13
Merged
Prakhar896 merged 20 commits intomainfrom Jun 23, 2024
Merged
First PR (Linked express router, added backend routes and some test routes, implemented error handling)#13Prakhar896 merged 20 commits intomainfrom
Prakhar896 merged 20 commits intomainfrom
Conversation
Sync-up PR (Joshua)
Sync-up PR (Joshua)
… and getting all food listings. Adjusted association for FoodListing DB Model to match attributes for Host
… Tested all routes, works perfectly.
Prakhar896
requested changes
Jun 23, 2024
Contributor
Prakhar896
left a comment
There was a problem hiding this comment.
A bit confused about some of your endpoints as there is quite a bit of duplication here and there. Great effort and use of multer. Some code can be re-factorised and optimised. See comments for more.
…y uploaded and simplified createHost route
…teUniqueID to improve security of UUIDs
Contributor
Author
|
@Prakhar896 changes made! 👍🏻 |
Prakhar896
requested changes
Jun 23, 2024
Contributor
Prakhar896
left a comment
There was a problem hiding this comment.
Great work. Almost at finish line.
Prakhar896
reviewed
Jun 23, 2024
| return; | ||
| } | ||
| res.status(200).sendFile(imageName, { root: "./FileStore" }); | ||
| if (findListing.images !== imageName) { |
Contributor
There was a problem hiding this comment.
Will need to change to findListing.images.split("|") later on. Do take note.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was done in this PR
1.) Added test route to create a sample Host (so a listing can be created and assigned to the Host as FK)
2.) Added test route to retrieve host info such as
usernameandfoodRating3.) Added route for retrieving all listings
4.) Added route for creating a new listing
5.) Added route for adding the uploaded image to Firebase Storage
6.) Added route to update the
imagesfield in the FoodListing to the public URL of the image uploaded to Firebase Storage7.) LOTS of error handling
Notes
1.)
/addListingcreates a listing based on a hard-coded hostuserID2.)
/hostInforetrieves host information based on a hard-coded hostuserIDThese hard-coded fields are temporary until we integrate
HostsandFoodListings---END OF PR---