cleanup user list menu, leftovers from moderation copypaste
This commit is contained in:
parent
fc177b5200
commit
30f7249948
1 changed files with 0 additions and 56 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
import { mapState } from 'pinia'
|
import { mapState } from 'pinia'
|
||||||
|
|
||||||
import DialogModal from '../dialog_modal/dialog_modal.vue'
|
|
||||||
import Popover from '../popover/popover.vue'
|
import Popover from '../popover/popover.vue'
|
||||||
|
|
||||||
import { useListsStore } from 'src/stores/lists.js'
|
import { useListsStore } from 'src/stores/lists.js'
|
||||||
|
|
@ -16,7 +15,6 @@ const UserListMenu = {
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
DialogModal,
|
|
||||||
Popover,
|
Popover,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -64,60 +62,6 @@ const UserListMenu = {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleRight(right) {
|
|
||||||
const store = this.$store
|
|
||||||
if (this.user.rights[right]) {
|
|
||||||
store.state.api.backendInteractor
|
|
||||||
.deleteRight({ user: this.user, right })
|
|
||||||
.then((response) => {
|
|
||||||
if (!response.ok) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
store.commit('updateRight', {
|
|
||||||
user: this.user,
|
|
||||||
right,
|
|
||||||
value: false,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
store.state.api.backendInteractor
|
|
||||||
.addRight({ user: this.user, right })
|
|
||||||
.then((response) => {
|
|
||||||
if (!response.ok) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
store.commit('updateRight', { user: this.user, right, value: true })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toggleActivationStatus() {
|
|
||||||
this.$store.dispatch('toggleActivationStatus', { user: this.user })
|
|
||||||
},
|
|
||||||
deleteUserDialog(show) {
|
|
||||||
this.showDeleteUserDialog = show
|
|
||||||
},
|
|
||||||
deleteUser() {
|
|
||||||
const store = this.$store
|
|
||||||
const user = this.user
|
|
||||||
const { id, name } = user
|
|
||||||
store.state.api.backendInteractor.deleteUser({ user }).then(() => {
|
|
||||||
this.$store.dispatch(
|
|
||||||
'markStatusesAsDeleted',
|
|
||||||
(status) => user.id === status.user.id,
|
|
||||||
)
|
|
||||||
const isProfile =
|
|
||||||
this.$route.name === 'external-user-profile' ||
|
|
||||||
this.$route.name === 'user-profile'
|
|
||||||
const isTargetUser =
|
|
||||||
this.$route.params.name === name || this.$route.params.id === id
|
|
||||||
if (isProfile && isTargetUser) {
|
|
||||||
window.history.back()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setToggled(value) {
|
|
||||||
this.toggled = value
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue