refactor: simplify buildCashUnitObj
This commit is contained in:
parent
d8a4f89194
commit
bb0b5766e4
1 changed files with 2 additions and 10 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue