-
Notifications
You must be signed in to change notification settings - Fork 0
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
setup_values_get_put_delete Issue #11 Resolved #16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
eslint
routes/valueRouter.js|109 col 9| Identifier 'canned_dog_food_quantity' is not in camel case.
routes/valueRouter.js|110 col 9| Identifier 'dry_dog_food_quantity' is not in camel case.
routes/valueRouter.js|111 col 9| Identifier 'canned_cat_food_quantity' is not in camel case.
routes/valueRouter.js|112 col 9| Identifier 'dry_cat_food_quantity' is not in camel case.
routes/valueRouter.js|113 col 9| Identifier 'misc_items' is not in camel case.
routes/valueRouter.js|114 col 9| Identifier 'volunteer_hours' is not in camel case.
routes/valueRouter.js
Outdated
try { | ||
const { id } = req.params; | ||
const { | ||
business_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
const { id } = req.params; | ||
const { | ||
business_id, | ||
donation_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
const { | ||
business_id, | ||
donation_id, | ||
food_bank_donation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
reporter, | ||
email, | ||
date, | ||
canned_dog_food_quantity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
email, | ||
date, | ||
canned_dog_food_quantity, | ||
dry_dog_food_quantity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
: '' | ||
} | ||
${dry_cat_food_quantity ? `, dry_cat_food_quantity = $(dry_cat_food_quantity) ` : ''} | ||
${misc_items ? `, misc_items = $(misc_items) ` : ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
} | ||
${dry_cat_food_quantity ? `, dry_cat_food_quantity = $(dry_cat_food_quantity) ` : ''} | ||
${misc_items ? `, misc_items = $(misc_items) ` : ''} | ||
${volunteer_hours ? `, volunteer_hours = $(volunteer_hours) ` : ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
RETURNING *;`, | ||
{ | ||
id, | ||
business_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
{ | ||
id, | ||
business_id, | ||
donation_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routes/valueRouter.js
Outdated
id, | ||
business_id, | ||
donation_id, | ||
food_bank_donation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the comments and resolve them. Overall make sure that you are using yarn format
and are not bypassing eslint error messages with a force commit.
app.js
Outdated
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: true })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure to pull in the code next time before you work, otherwise we will lose some code
valueRouter.put('/:id', async (req, res) => { | ||
try { | ||
const { id } = req.params; | ||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { business_id: businessId, message, timestamp, been_dismissed: beenDismissed } = req.body;
do it like so, we redefine the snake case into camel case so that we have consistent variables across our different code packages
routes/valueRouter.js
Outdated
misc_items, | ||
volunteer_hours, | ||
} = req.body; | ||
if (!business_id) throw new Error('business_id is required.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this, we will be doing frontend validation instead.
routes/valueRouter.js
Outdated
if (!business_id) throw new Error('business_id is required.'); | ||
if (!donation_id) throw new Error('donation_id line is required.'); | ||
if (!food_bank_donation) throw new Error('food_bank_donation is required.'); | ||
if (!reporter) throw new Error('business_id is required.'); | ||
if (!email) throw new Error('donation_id line is required.'); | ||
if (!date) throw new Error('food_bank_donation is required.'); | ||
if (!canned_dog_food_quantity) throw new Error('canned_dog_food_quantity is required.'); | ||
if (!dry_dog_food_quantity) throw new Error('dry_dog_food_quantity line is required.'); | ||
if (!canned_cat_food_quantity) throw new Error('canned_cat_food_quanitty is required.'); | ||
if (!dry_cat_food_quantity) throw new Error('dry_cat_food_quantity is required.'); | ||
if (!misc_items) throw new Error('misc_items line is required.'); | ||
if (!volunteer_hours) throw new Error('volunteer_hours is required.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all of these "is required" lines", we will be doing frontend validation instead.
Added GET PUT DELETE route handling functions to ValueRouter.js