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
We've all accidentally deleted something before. Let's give this app a CTRL+Z! We initially discussed accomplishing this by storing all purchase dates as an array, however, Andrew made the excellent point that if you use the app for years, those array entries start to add up. If memory serves, he suggested adding two fields to the item document in firestore:
previousDateLastPurchased
previousDateNextPurchased
Acceptance criteria
Implement the logic to add and utilize these two fields in order to successfully uncheck an item
When a user unchecks an item, the values fordateNextpurchased and dateLastPurchased should return to their previous values, isChecked should be false, and the totalPurchases should be decremented by 1.
Notes
-You're brilliant!
-Think about what happens to the values of our two, new fields. What should these be set to?
The text was updated successfully, but these errors were encountered:
Summary
We've all accidentally deleted something before. Let's give this app a
CTRL+Z
! We initially discussed accomplishing this by storing all purchase dates as an array, however, Andrew made the excellent point that if you use the app for years, those array entries start to add up. If memory serves, he suggested adding two fields to the item document in firestore:previousDateLastPurchased
previousDateNextPurchased
Acceptance criteria
dateNextpurchased
anddateLastPurchased
should return to their previous values,isChecked
should befalse
, and thetotalPurchases
should be decremented by 1.Notes
-You're brilliant!
-Think about what happens to the values of our two, new fields. What should these be set to?
The text was updated successfully, but these errors were encountered: