Implements feature status delete

Fixes issue #4
This commit is contained in:
Jiayi Zheng 2016-12-04 18:30:00 +01:00
parent df51d08814
commit 75fdc72e22
6 changed files with 48 additions and 2 deletions

View file

@ -20,7 +20,9 @@ const Status = {
},
loggedIn () {
return !!this.$store.state.users.currentUser
}
},
deleted () { return this.statusoid.deleted },
canDelete () { return this.statusoid.user.rights.delete_others_notice || this.statusoid.user.id == this.$store.state.users.currentUser.id }
},
components: {
Attachment,
@ -31,6 +33,12 @@ const Status = {
methods: {
toggleReplying () {
this.replying = !this.replying
},
deleteStatus () {
const confirmed = confirm('Do you really want to delete this status?')
if (confirmed) {
this.$store.dispatch('deleteStatus', { id: this.status.id })
}
}
}
}