Load admin's organizations when loading users table

pull/2600/head
Luke Morris 2017-12-15 13:57:00 -08:00
parent 3227bc0b3e
commit a53cf684df
1 changed files with 7 additions and 0 deletions

View File

@ -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,