Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project-mongo-api - Mai #499

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

maikanetaka
Copy link

Copy link

@wwenzz wwenzz left a comment

Choose a reason for hiding this comment

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

Well done Mai! I love how you implemented try...catch block to every endpoint, this shows you really paid attention to error handling.
Yet I encountered some errors when accessing your endpoints. "/avocade-sales" leads to 500 error. Could you kindly look into that? Might be deploy error...

server.js Outdated
expressListEndpoints(app).map((endpoint) => ({
method: endpoint.methods.join(", "),
path: endpoint.path,
description: "Describe what each endpoint does", // Consider adding more detailed descriptions
Copy link

Choose a reason for hiding this comment

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

Are you going to add the description for each endpoint? Currently it shows the same thing...

// List all sales
app.get("/avocado-sales", async (req, res) => {
try {
const sales = await AvocadoSales.find().select("-_id -__v").sort({ id: 1 });
Copy link

Choose a reason for hiding this comment

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

nice implement of select method!
yet this endpoint leads to error... which shows error code 500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants