Show different success message for user delete from AllUsersPage vs UsersPage

pull/10616/head
Jared Scheib 2018-01-26 19:13:11 -08:00
parent 8d494d4588
commit 37eacef8c9
3 changed files with 9 additions and 4 deletions

View File

@ -160,14 +160,19 @@ export const updateUserAsync = (user, updatedUser) => async dispatch => {
} }
} }
export const deleteUserAsync = user => async dispatch => { export const deleteUserAsync = (
user,
{isAbsoluteDelete} = {}
) => async dispatch => {
dispatch(removeUser(user)) dispatch(removeUser(user))
try { try {
await deleteUserAJAX(user) await deleteUserAJAX(user)
dispatch( dispatch(
publishAutoDismissingNotification( publishAutoDismissingNotification(
'success', 'success',
`User removed from organization: ${user.scheme}::${user.provider}::${user.name}` `User removed from ${isAbsoluteDelete
? 'all organizations and deleted'
: 'organization'}: ${user.scheme}::${user.provider}::${user.name}`
) )
) )
} catch (error) { } catch (error) {

View File

@ -45,7 +45,7 @@ class AllUsersPage extends Component {
handleDeleteUser = user => { handleDeleteUser = user => {
const {actionsAdmin: {deleteUserAsync}} = this.props const {actionsAdmin: {deleteUserAsync}} = this.props
deleteUserAsync(user) deleteUserAsync(user, {isAbsoluteDelete: true})
} }
async componentWillMount() { async componentWillMount() {

View File

@ -33,7 +33,7 @@ class UsersPage extends Component {
handleDeleteUser = user => { handleDeleteUser = user => {
const {actions: {deleteUserAsync}} = this.props const {actions: {deleteUserAsync}} = this.props
deleteUserAsync(user) deleteUserAsync(user, {isAbsoluteDelete: false})
} }
async componentWillMount() { async componentWillMount() {