fix: simplify return value

This commit is contained in:
Sérgio Salgado 2021-02-18 12:46:24 +00:00 committed by Josh Harvey
parent 44980bbf9c
commit bcafe38dd3

View file

@ -42,9 +42,7 @@ const getView = (data, code, compare) => it => {
// The following boolean should come undefined if it is rendering an unpaired machine
const hasValue = R.find(R.propEq(compare ?? 'code', it))(data)
return hasValue
? R.compose(R.prop(code), R.find(R.propEq(compare ?? 'code', it)))(data)
: 'Unpaired machine'
return hasValue ? R.compose(R.prop(code), hasValue)(data) : 'Unpaired machine'
}
const displayCodeArray = data => it => {