fix: reads denominations config on flat style
This commit is contained in:
parent
0adecf02f0
commit
a73b49ef29
1 changed files with 9 additions and 7 deletions
|
|
@ -33,6 +33,7 @@ const ValidationSchema = Yup.object().shape({
|
||||||
denomination: Yup.number()
|
denomination: Yup.number()
|
||||||
.required('Required')
|
.required('Required')
|
||||||
.integer()
|
.integer()
|
||||||
|
.default(0)
|
||||||
}),
|
}),
|
||||||
cashout2: Yup.object()
|
cashout2: Yup.object()
|
||||||
.required('Required')
|
.required('Required')
|
||||||
|
|
@ -44,6 +45,7 @@ const ValidationSchema = Yup.object().shape({
|
||||||
denomination: Yup.number()
|
denomination: Yup.number()
|
||||||
.required('Required')
|
.required('Required')
|
||||||
.integer()
|
.integer()
|
||||||
|
.default(0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -90,15 +92,15 @@ const Cashboxes = () => {
|
||||||
const [machines, setMachines] = useState([])
|
const [machines, setMachines] = useState([])
|
||||||
|
|
||||||
useQuery(GET_MACHINES_AND_CONFIG, {
|
useQuery(GET_MACHINES_AND_CONFIG, {
|
||||||
onCompleted: data =>
|
onCompleted: ({ machines, config }) =>
|
||||||
setMachines(
|
setMachines(
|
||||||
data.machines.map(m => ({
|
machines.map(m => ({
|
||||||
...m,
|
...m,
|
||||||
// TODO: move this to the new flat config style
|
currency: { code: config.locale_fiatCurrency ?? '' },
|
||||||
currency: data.config.fiatCurrency ?? { code: 'N/D' },
|
denominations: {
|
||||||
denominations: (data.config.cashOutDenominations ?? {})[
|
top: config[`denominations_${m.deviceId}_top`],
|
||||||
m.deviceId
|
bottom: config[`denominations_${m.deviceId}_bottom`]
|
||||||
] || { top: 11111, bottom: 22222 }
|
}
|
||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue