Move delete button for status into a component
This commit is contained in:
parent
7b5a30db14
commit
1c75feae60
4 changed files with 40 additions and 21 deletions
16
src/components/delete_button/delete_button.js
Normal file
16
src/components/delete_button/delete_button.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
const DeleteButton = {
|
||||
props: [ 'status' ],
|
||||
methods: {
|
||||
deleteStatus () {
|
||||
const confirmed = confirm('Do you really want to delete this status?')
|
||||
if (confirmed) {
|
||||
this.$store.dispatch('deleteStatus', { id: this.status.id })
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
canDelete () { return this.status.user.rights.delete_others_notice || this.status.user.id == this.$store.state.users.currentUser.id }
|
||||
}
|
||||
}
|
||||
|
||||
export default DeleteButton
|
Loading…
Add table
Add a link
Reference in a new issue