Admin: refactor fetchUsers() action
This commit is contained in:
@@ -39,8 +39,7 @@ class AwaitingApproval extends ImmutablePureComponent {
|
||||
|
||||
componentDidMount() {
|
||||
const { dispatch } = this.props;
|
||||
const params = { page: 1, filters: 'local,need_approval' };
|
||||
dispatch(fetchUsers(params))
|
||||
dispatch(fetchUsers(['local', 'need_approval']))
|
||||
.then(() => this.setState({ isLoading: false }))
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ class UserIndex extends ImmutablePureComponent {
|
||||
|
||||
fetchNextPage = () => {
|
||||
const nextPage = this.state.page + 1;
|
||||
const filters = this.state.filters.toJS().join();
|
||||
const filters = this.state.filters.toJS();
|
||||
|
||||
this.props.dispatch(fetchUsers({ filters, page: nextPage }))
|
||||
this.props.dispatch(fetchUsers(filters, nextPage))
|
||||
.then(({ users, count }) => {
|
||||
const newIds = users.map(user => user.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user