Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-14410: Adds the ability to add and manage groups for a team. #2707

Merged
merged 7 commits into from
May 10, 2019
Prev Previous commit
Next Next commit
MM-14410: Removes some duplication.
  • Loading branch information
mkraft committed May 9, 2019
commit 61be3478d15020b15dec56d6d16f8358439c33cf
14 changes: 8 additions & 6 deletions components/list_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,19 @@ export default class ListModal extends React.PureComponent {
}

onNext = async () => {
mkraft marked this conversation as resolved.
Show resolved Hide resolved
this.setState({loading: true});
const nextPage = this.state.page + 1;
const items = await this.props.loadItems(nextPage, this.state.searchTerm);
this.setState({page: nextPage, items, loading: false});
this.onPageChange(nextPage);
}

onPrev = async () => {
mkraft marked this conversation as resolved.
Show resolved Hide resolved
this.setState({loading: true});
const prevPage = this.state.page - 1;
const items = await this.props.loadItems(prevPage, this.state.searchTerm);
this.setState({page: prevPage, items, loading: false});
this.onPageChange(prevPage);
}

onPageChange = async (page) => {
this.setState({loading: true});
const items = await this.props.loadItems(page, this.state.searchTerm);
this.setState({page, items, loading: false});
}

onSearchInput = async (event) => {
Expand Down