fix: simplify return value
This commit is contained in:
parent
44980bbf9c
commit
bcafe38dd3
1 changed files with 1 additions and 3 deletions
|
|
@ -42,9 +42,7 @@ const getView = (data, code, compare) => it => {
|
||||||
// The following boolean should come undefined if it is rendering an unpaired machine
|
// The following boolean should come undefined if it is rendering an unpaired machine
|
||||||
const hasValue = R.find(R.propEq(compare ?? 'code', it))(data)
|
const hasValue = R.find(R.propEq(compare ?? 'code', it))(data)
|
||||||
|
|
||||||
return hasValue
|
return hasValue ? R.compose(R.prop(code), hasValue)(data) : 'Unpaired machine'
|
||||||
? R.compose(R.prop(code), R.find(R.propEq(compare ?? 'code', it)))(data)
|
|
||||||
: 'Unpaired machine'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const displayCodeArray = data => it => {
|
const displayCodeArray = data => it => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue