Open lascellesabercrombie opened 2 years ago
https://github.com/fac24/week6-bereket-hussain-joe-sonia/blob/dd48edae591844451ef295da7a8b37137a687c07/pages/products/%5Bname%5D.js#L40
As with my previous issue, not really an issue. But I quite liked this bit in some code George and Minju wrote:
<input type="number" id="quantity" name="quantity" min="1" max={productData.stock} value={quantity} onChange={(event) => setQuantity(event.target.value)} />
Here, the maximum in't an arbitrary number but is tied to a column in the database, so a customer can never attempt to order more of a thing than you have in stock. Then again, I'm not sure whether traders in emotions need to consider scarcity.
Yeah, that constraining by stock is a great (and realistic :) idea!
It's true, we hadn't really considered stock levels yet -- the assumption was they're infinite ;)
https://github.com/fac24/week6-bereket-hussain-joe-sonia/blob/dd48edae591844451ef295da7a8b37137a687c07/pages/products/%5Bname%5D.js#L40
As with my previous issue, not really an issue. But I quite liked this bit in some code George and Minju wrote:
Here, the maximum in't an arbitrary number but is tied to a column in the database, so a customer can never attempt to order more of a thing than you have in stock. Then again, I'm not sure whether traders in emotions need to consider scarcity.