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
701 B
26 lines
701 B
import { connect } from 'react-redux'
|
|
import { handleApiError } from 'src/api/errors'
|
|
import { fetchLogs } from 'src/actions/directory'
|
|
import { getLogs } from 'src/selectors/directory'
|
|
import { AppState, AppThunkDispatch } from 'src/types'
|
|
|
|
import GroupLogs, { Props } from './group-logs'
|
|
|
|
const mapStateToProps = (state: AppState) => ({
|
|
logs: getLogs(state),
|
|
})
|
|
|
|
const mapDispatchToProps = (dispatch: AppThunkDispatch, ownProps: Props) => ({
|
|
fetchLogs: () => {
|
|
try {
|
|
dispatch(fetchLogs(ownProps.group))
|
|
} catch (err) {
|
|
handleApiError(err, dispatch)
|
|
}
|
|
},
|
|
})
|
|
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(GroupLogs)
|