-
Notifications
You must be signed in to change notification settings - Fork 0
[SSF-79] Improve Peformance for Log New Donation Form Modal #58
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
base: main
Are you sure you want to change the base?
[SSF-79] Improve Peformance for Log New Donation Form Modal #58
Conversation
3c5bca7 to
3c3e332
Compare
d73a38e to
20b9bbe
Compare
amywng
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.
can you change the field in donationItems entity to donationId instead of donation_id, also merge main so i can run it w/o issues
apps/backend/src/donationItems/donationItems.controller.spec.ts
Outdated
Show resolved
Hide resolved
apps/frontend/src/components/forms/deliveryConfirmationModal.tsx
Outdated
Show resolved
Hide resolved
apps/frontend/src/components/forms/deliveryConfirmationModal.tsx
Outdated
Show resolved
Hide resolved
apps/frontend/src/components/forms/deliveryConfirmationModal.tsx
Outdated
Show resolved
Hide resolved
| totalValue = 0; | ||
|
|
||
| updatedRows.forEach((row) => { | ||
| if (row.numItems && row.ozPerItem && row.valuePerItem) { |
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.
imo i feel like we shouldn't wait til they're all filled out, but update as any row is changed (also know this isn't part of your ticket but food for thought ig
apps/backend/src/donationItems/dtos/create-donationItems.dto.ts
Outdated
Show resolved
Hide resolved
apps/backend/src/donationItems/dtos/create-donationItems.dto.ts
Outdated
Show resolved
Hide resolved
apps/backend/src/donationItems/dtos/create-donation-items.dto.ts
Outdated
Show resolved
Hide resolved
apps/backend/src/donationItems/donationItems.controller.spec.ts
Outdated
Show resolved
Hide resolved
amywng
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.
we need to add validation to the form because i was able to submit an invalid entry and it added it to the database but i'm going to say that is whoever does the new form's job
amywng
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.
couple small comments. once justin's pr goes in you'll have to fix the status stuff but i'm approving
| return; | ||
| } | ||
|
|
||
| onClose(); |
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.
what's the reason we close it first? it works asyncly is what i am understanding how you can set this as closed before api call finishes. is this just better design
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.
Not really, you make a good point. I think it should not really matter where we place it, but for error handling, it is probably better for them to receive some browser alert if something went wrong before closing it. I just changed the location!
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.
test
Yurika-Kan
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.
good! just minor clarifications
Yurika-Kan
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.
some more comments ><
| <Table.Cell> | ||
| <Input | ||
| type="number" | ||
| min={0} |
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.
should this be min={1} to match the backend dto ozPerItem being @min(1)
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.
Fixed this for all of them
ℹ️ Issue
Closes #79
📝 Description
✔️ Verification
Ensured only 1 api call was being made via console logs
Successful confirmation of 1 api call being made:

🏕️ (Optional) Future Work / Notes
Still need to write tests for the rest of the controllers, as well as the services. We are holding off on service tests for now though, pending a potential change in how we do testing.