AutosuggestAccountInput: configurable limit prop
This commit is contained in:
parent
e8005b9cf6
commit
f6f410d276
1 changed files with 7 additions and 6 deletions
|
@ -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 => {
|
||||||
|
|
Loading…
Reference in a new issue