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))
|
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) {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue