AutosuggestAccountInput: configurable limit prop

merge-requests/788/head
Alex Gleason 2021-10-14 10:48:17 -05:00
rodzic e8005b9cf6
commit f6f410d276
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -23,6 +23,11 @@ class AutosuggestAccountInput extends ImmutablePureComponent {
intl: PropTypes.object.isRequired, intl: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired,
onSelected: PropTypes.func.isRequired, onSelected: PropTypes.func.isRequired,
limit: PropTypes.number,
}
static defaultProps = {
limit: 4,
} }
state = { state = {
@ -39,14 +44,10 @@ class AutosuggestAccountInput extends ImmutablePureComponent {
} }
handleAccountSearch = throttle(q => { handleAccountSearch = throttle(q => {
const { dispatch } = this.props; const { dispatch, limit } = this.props;
const source = this.refreshCancelToken(); const source = this.refreshCancelToken();
const params = { const params = { q, limit, resolve: false };
q,
resolve: false,
limit: 4,
};
dispatch(accountSearch(params, source.token)) dispatch(accountSearch(params, source.token))
.then(accounts => { .then(accounts => {