From 4d62506c25a425223f1f6b49f1e51296803e499e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Tue, 16 Mar 2021 15:19:45 +0000 Subject: [PATCH] fix: commission override function composition --- new-lamassu-admin/src/pages/Commissions/helper.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/new-lamassu-admin/src/pages/Commissions/helper.js b/new-lamassu-admin/src/pages/Commissions/helper.js index df490800..a07fff4b 100644 --- a/new-lamassu-admin/src/pages/Commissions/helper.js +++ b/new-lamassu-admin/src/pages/Commissions/helper.js @@ -40,9 +40,11 @@ const getView = (data, code, compare) => it => { if (!data) return '' // The following boolean should come undefined if it is rendering an unpaired machine - const hasValue = R.find(R.propEq(compare ?? 'code', it))(data) + const findAttribute = R.find(R.propEq(compare ?? 'code', it)) - return hasValue ? R.compose(R.prop(code), hasValue)(data) : 'Unpaired machine' + return findAttribute(data) + ? R.compose(R.prop(code), findAttribute)(data) + : 'Unpaired machine' } const displayCodeArray = data => it => {