Show different success message for user delete from AllUsersPage vs UsersPage
parent
8d494d4588
commit
37eacef8c9
|
@ -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))
|
||||
try {
|
||||
await deleteUserAJAX(user)
|
||||
dispatch(
|
||||
publishAutoDismissingNotification(
|
||||
'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) {
|
||||
|
|
|
@ -45,7 +45,7 @@ class AllUsersPage extends Component {
|
|||
|
||||
handleDeleteUser = user => {
|
||||
const {actionsAdmin: {deleteUserAsync}} = this.props
|
||||
deleteUserAsync(user)
|
||||
deleteUserAsync(user, {isAbsoluteDelete: true})
|
||||
}
|
||||
|
||||
async componentWillMount() {
|
||||
|
|
|
@ -33,7 +33,7 @@ class UsersPage extends Component {
|
|||
|
||||
handleDeleteUser = user => {
|
||||
const {actions: {deleteUserAsync}} = this.props
|
||||
deleteUserAsync(user)
|
||||
deleteUserAsync(user, {isAbsoluteDelete: false})
|
||||
}
|
||||
|
||||
async componentWillMount() {
|
||||
|
|
Loading…
Reference in New Issue