You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
780 B
26 lines
780 B
import { connect } from 'react-redux'
|
|
import { handleApiError } from 'src/api/errors'
|
|
import { fetchGroupMembers } from 'src/actions/directory'
|
|
import { getGroupMembers } from 'src/selectors/directory'
|
|
import { AppState, AppThunkDispatch } from 'src/types'
|
|
|
|
import MemberList, { Props } from './member-list'
|
|
|
|
const mapStateToProps = (state: AppState, ownProps: Props) => ({
|
|
members: getGroupMembers(state, ownProps.group),
|
|
})
|
|
|
|
const mapDispatchToProps = (dispatch: AppThunkDispatch, ownProps: Props) => ({
|
|
fetchGroupMembers: () => {
|
|
try {
|
|
dispatch(fetchGroupMembers(ownProps.group))
|
|
} catch (err) {
|
|
handleApiError(err, dispatch)
|
|
}
|
|
},
|
|
})
|
|
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(MemberList)
|