aboutsummaryrefslogtreecommitdiff
path: root/src/components/delete_button/delete_button.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/delete_button/delete_button.js')
-rw-r--r--src/components/delete_button/delete_button.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/delete_button/delete_button.js b/src/components/delete_button/delete_button.js
new file mode 100644
index 00000000..5f824899
--- /dev/null
+++ b/src/components/delete_button/delete_button.js
@@ -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