Fix max length eslint rule

This commit is contained in:
Pavel Dohnal
2019-01-23 11:48:13 +01:00
parent 28f43c4077
commit 0a7a5ee0b9
2 changed files with 11 additions and 6 deletions

View File

@@ -28,7 +28,6 @@
"no-restricted-globals": 0, // todo "no-restricted-globals": 0, // todo
"max-len": 0, // todo
"prefer-destructuring": 0, // todo "prefer-destructuring": 0, // todo
"react/default-props-match-prop-types": 0, // todo "react/default-props-match-prop-types": 0, // todo
"react/no-access-state-in-setstate": 0, // todo "react/no-access-state-in-setstate": 0, // todo

View File

@@ -141,11 +141,17 @@ class Selection extends React.Component {
}; };
}, },
processResults: function processResults(response) { processResults: function processResults(response) {
return { let results;
results: (!_.has(response, 'data')) if (!_.has(response, 'data')) {
? [] results = [];
: response.data.map(item => ({ id: item.id || item.value, text: item.name || item.text })), } else {
}; results = response.data.map((item) => {
const id = item.id || item.value;
const text = item.name || item.text;
return { id, text };
});
}
return { results };
}, },
}, },
minimumInputLength: remoteQuery.minimumInputLength || 2, minimumInputLength: remoteQuery.minimumInputLength || 2,