You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see the word availability everywhere and I'm not sure what it means. Do you mean 'in season' or 'in stock' or something else? I have to look at many other things to grasp the context for reading this word.
db
Have consistent exports, export in all files at the end of the top, currently users.js is different from the rest and it should look like your code.
This function could be reduced as there is a lot of repetitive code, the only thing changing is the array. You could have variables that replace the numbers array based on the season rather than repeating the entire db function.
Remove comments, route should be clear on what is being requested. // Get all availability for a season
Routes should be in relevant collections. So I would expect :
// Get all availability with the same produce_id
router.get('/produce/:produce_id', async (req, res) => {
try {
const result = await db.readAvailabilityByProduceId(req.params.produce_id)
res.json(result)
} catch (err) {
res.status(500).send(err.message)
}
})
to be in the produce.js file instead.
The text was updated successfully, but these errors were encountered:
General
I see the word
availability
everywhere and I'm not sure what it means. Do you mean 'in season' or 'in stock' or something else? I have to look at many other things to grasp the context for reading this word.db
users.js
is different from the rest and it should look like your code.routes
req.params.id
into an integer.// Get all availability for a season
to be in the
produce.js
file instead.The text was updated successfully, but these errors were encountered: