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