Admin: refactor fetchUsers() action

This commit is contained in:
Alex Gleason
2021-07-13 17:27:11 -05:00
parent 3043924045
commit 732fba73f5
4 changed files with 10 additions and 9 deletions

View File

@@ -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(() => {});
}

View File

@@ -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);