2016-12-07 12:50:46 -08:00
|
|
|
const DeleteButton = {
|
|
|
|
props: [ 'status' ],
|
|
|
|
methods: {
|
|
|
|
deleteStatus () {
|
2017-02-22 13:43:40 -08:00
|
|
|
const confirmed = window.confirm('Do you really want to delete this status?')
|
2016-12-07 12:50:46 -08:00
|
|
|
if (confirmed) {
|
|
|
|
this.$store.dispatch('deleteStatus', { id: this.status.id })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
2016-12-08 11:26:05 -08:00
|
|
|
currentUser () { return this.$store.state.users.currentUser },
|
2018-03-20 06:33:43 -07:00
|
|
|
canDelete () { return this.currentUser && this.currentUser.rights.delete_others_notice || this.status.user.id === this.currentUser.id }
|
2016-12-07 12:50:46 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DeleteButton
|