Skip to content

First PR (Linked express router, added backend routes and some test routes, implemented error handling)#13

Merged
Prakhar896 merged 20 commits intomainfrom
joshua
Jun 23, 2024
Merged

First PR (Linked express router, added backend routes and some test routes, implemented error handling)#13
Prakhar896 merged 20 commits intomainfrom
joshua

Conversation

@Sadliquid
Copy link
Copy Markdown
Contributor

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 username and foodRating
3.) 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 images field in the FoodListing to the public URL of the image uploaded to Firebase Storage
7.) LOTS of error handling

Notes

1.) /addListing creates a listing based on a hard-coded host userID
2.) /hostInfo retrieves host information based on a hard-coded hostuserID

These hard-coded fields are temporary until we integrate Hosts and FoodListings

---END OF PR---

@Sadliquid Sadliquid requested a review from Prakhar896 June 22, 2024 11:06
Copy link
Copy Markdown
Contributor

@Prakhar896 Prakhar896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread config/boilerplateConfig.json
Comment thread middleware/ListingsFileFilter.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
@Prakhar896 Prakhar896 added the enhancement New feature or request label Jun 23, 2024
@Sadliquid
Copy link
Copy Markdown
Contributor Author

@Prakhar896 changes made! 👍🏻

@Sadliquid Sadliquid requested a review from Prakhar896 June 23, 2024 12:39
Copy link
Copy Markdown
Contributor

@Prakhar896 Prakhar896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Almost at finish line.

Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js
return;
}
res.status(200).sendFile(imageName, { root: "./FileStore" });
if (findListing.images !== imageName) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need to change to findListing.images.split("|") later on. Do take note.

Copy link
Copy Markdown
Contributor

@Prakhar896 Prakhar896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Prakhar896 Prakhar896 merged commit 3b7a3d2 into main Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants