show error in case user deletion goes wrong
This commit is contained in:
@@ -76,9 +76,16 @@ export default {
|
|||||||
async deleteUser (user) {
|
async deleteUser (user) {
|
||||||
const ret = await this.$root.$confirm('admin.delete_user_confirm', { user: user.email })
|
const ret = await this.$root.$confirm('admin.delete_user_confirm', { user: user.email })
|
||||||
if (!ret) { return }
|
if (!ret) { return }
|
||||||
await this.$axios.delete(`/user/${user.id}`)
|
try {
|
||||||
this.$root.$message('admin.user_remove_ok')
|
this.loading = true
|
||||||
this.$emit('update')
|
await this.$axios.$delete(`/user/${user.id}`)
|
||||||
|
this.$root.$message('admin.user_remove_ok')
|
||||||
|
this.$emit('update')
|
||||||
|
} catch (e) {
|
||||||
|
const err = get(e, 'response.data.errors[0].message', e)
|
||||||
|
this.$root.$message(this.$t(err), { color: 'error' })
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async toggle (user) {
|
async toggle (user) {
|
||||||
if (user.is_active) {
|
if (user.is_active) {
|
||||||
|
|||||||
Reference in New Issue
Block a user