Commit abcaaaad authored by Martin Fahl's avatar Martin Fahl

generates id

parent 6640b383
......@@ -26,10 +26,14 @@ const getNewQuantity = createSelector(
}
)
const genId = () => {
return String(Math.floor(Math.random()*10000))
}
const handleAdd = (name, quantity, dispatch) => {
if (name !== "") {
dispatch(closeAddDialog());
dispatch(addItem(name, quantity))
dispatch(addItem(genId(), name, quantity))
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment