Load admin's organizations when loading users table
parent
3227bc0b3e
commit
a53cf684df
|
@ -22,6 +22,7 @@ class AdminChronografPage extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.loadOrganizations()
|
||||
this.loadUsers()
|
||||
}
|
||||
|
||||
|
@ -31,6 +32,11 @@ class AdminChronografPage extends Component {
|
|||
loadUsersAsync(links.users)
|
||||
}
|
||||
|
||||
loadOrganizations = () => {
|
||||
const {links, actions: {loadOrganizationsAsync}} = this.props
|
||||
loadOrganizationsAsync(links.organizations)
|
||||
}
|
||||
|
||||
// SINGLE USER ACTIONS
|
||||
handleCreateUser = user => {
|
||||
const {links, actions: {createUserAsync}} = this.props
|
||||
|
@ -131,6 +137,7 @@ AdminChronografPage.propTypes = {
|
|||
meID: string.isRequired,
|
||||
actions: shape({
|
||||
loadUsersAsync: func.isRequired,
|
||||
loadOrganizationsAsync: func.isRequired,
|
||||
createUserAsync: func.isRequired,
|
||||
updateUserAsync: func.isRequired,
|
||||
deleteUserAsync: func.isRequired,
|
||||
|
|
Loading…
Reference in New Issue