From d065baeda988e48712cd8062bc3f2c8a5dddc03a Mon Sep 17 00:00:00 2001 From: Liordino Neto Date: Wed, 7 Oct 2020 18:20:43 -0300 Subject: [PATCH] fix: moved coin filter from the front-end to the server --- lib/admin/config.js | 2 +- lib/new-admin/config/index.js | 2 +- new-lamassu-admin/src/pages/Locales/helper.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/admin/config.js b/lib/admin/config.js index ca10ab3e..716b3eed 100644 --- a/lib/admin/config.js +++ b/lib/admin/config.js @@ -136,7 +136,7 @@ function massageCurrencies (currencies) { const codeToRec = code => _.find(_.matchesProperty('code', code), mapped) const top5 = _.map(codeToRec, top5Codes) const raw = _.uniqBy(_.get('code'), _.concat(top5, mapped)) - return raw.filter(r => r.code[0] !== 'X' && r.display.indexOf('(') === -1) + return raw.filter(r => r.code !== '' && r.code[0] !== 'X' && r.display.indexOf('(') === -1) } const mapLanguage = lang => { diff --git a/lib/new-admin/config/index.js b/lib/new-admin/config/index.js index 45ff7b63..3ca48355 100644 --- a/lib/new-admin/config/index.js +++ b/lib/new-admin/config/index.js @@ -17,7 +17,7 @@ function massageCurrencies (currencies) { const codeToRec = code => _.find(_.matchesProperty('code', code), mapped) const top5 = _.map(codeToRec, top5Codes) const raw = _.uniqBy(_.get('code'), _.concat(top5, mapped)) - return raw.filter(r => r.code[0] !== 'X' && r.display.indexOf('(') === -1) + return raw.filter(r => r.code !== '' && r.code[0] !== 'X' && r.display.indexOf('(') === -1) } const mapLanguage = lang => { diff --git a/new-lamassu-admin/src/pages/Locales/helper.js b/new-lamassu-admin/src/pages/Locales/helper.js index 8f015757..2688045a 100644 --- a/new-lamassu-admin/src/pages/Locales/helper.js +++ b/new-lamassu-admin/src/pages/Locales/helper.js @@ -73,7 +73,7 @@ const allFields = (getData, auxElements = []) => { view: getView(currencyData, 'code'), input: Autocomplete, inputProps: { - options: currencyData?.filter(c => c.code !== ''), + options: currencyData, valueProp: 'code', getLabel: R.path(['code']) }