-
Notifications
You must be signed in to change notification settings - Fork 0
created donors table, added routes, updated the backend, and created … #143
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
Conversation
…a component for donation filter
Co-authored-by: Arnav Kanekar <arnavk377@users.noreply.github.com>
…ithub.com/ctc-uci/cch into 140-donations-styling-functionality-CK-AK
Co-authored-by: Colin Kwon <Cobby914@users.noreply.github.com>
…to 142-update-donors
Co-authored-by: Colin Kwon <Cobby914@users.noreply.github.com>
filter and search changes
srukelman
left a comment
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.
hey guys this looks good so far the only issue i saw was the post and put requests not working for editing and creating donations. i fixed the post for ygs, so all u should need to fix is the PUT. also when i go to add a donation there are no donors in the dropdown

also the date input on the add donation isn't working for me if ygs could fix that as well
server/routes/donations.ts
Outdated
| const donor_id = await db.query( | ||
| `SELECT id FROM donors WHERE name = $1`, | ||
| [donor] | ||
| ); | ||
| const data = await db.query( | ||
| `UPDATE donations SET date = COALESCE($1, date),weight = COALESCE($2, weight),value = COALESCE($3, value), | ||
| donor = COALESCE($4, donor), category = COALESCE($5, category) WHERE id = $6 RETURNING id`, | ||
| [date, weight, value, donor, category, id] | ||
| donor_id = COALESCE($4, donor_id), category = COALESCE($5, category) WHERE id = $6 RETURNING id`, | ||
| [date, weight, value, donor_id, category, 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.
i think this doesn't work. take a look at how i wrote this for the post request on line 343. the problem is that the await for the donor doesn't finish getting retrieved from the db so it's undefined in the second call
Co-authored-by: Colin Kwon <Cobby914@users.noreply.github.com>
…a component for donation filter
Description
Screenshots/Media
Issues
Closes #