refactor: simplify buildCashUnitObj

This commit is contained in:
siiky 2023-10-19 20:21:28 +01:00
parent d8a4f89194
commit bb0b5766e4

View file

@ -52,16 +52,8 @@ const Wizard = ({ machine, cashoutSettings, locale, onClose, save, error }) => {
const title = `Update counts` const title = `Update counts`
const isLastStep = step === LAST_STEP const isLastStep = step === LAST_STEP
const buildCashUnitObj = (fields, cassetteInput) => { const buildCashUnitObj = (fields, cassetteInput) =>
return R.reduce( R.pipe(R.pickAll(fields), R.map(defaultToZero))(cassetteInput)
(acc, value) => {
acc[value] = defaultToZero(cassetteInput[value])
return acc
},
{},
fields
)
}
const onContinue = it => { const onContinue = it => {
const newConfig = R.merge(config, it) const newConfig = R.merge(config, it)