btsuda11 / Lifelift-Coffee

0 stars 0 forks source link

FSP Sample State #2

Open mwmadsen67 opened 1 year ago

mwmadsen67 commented 1 year ago

Sample State

mwmadsen67 commented 1 year ago

Hi Brendan, everything looks good. Only thing I would add is that in the products slice of state, it should have an imageUrl. Its not something you'll store in the database, but you'll use active storage and aws, as you'll find out with some of the later readings, and you'll have access to it in the global state.

Otherwise it looks great!

btsuda11 commented 1 year ago

Thanks Mike! I was wondering if it is necessary for the cart_items to have price as well so that the cart can be updated or is it sufficient for only the products to have price?

mwmadsen67 commented 1 year ago

you could decide to store the total price on the cart state if you'd like, up to you! It's really just a choice between doing the math on the backend and sending it up, vs doing the math on the frontend.