diff --git a/resources/assets/js/components/Micro.vue b/resources/assets/js/components/Micro.vue index e3f7b685e..b2b66bc20 100644 --- a/resources/assets/js/components/Micro.vue +++ b/resources/assets/js/components/Micro.vue @@ -3,7 +3,6 @@ \ No newline at end of file diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index fff135157..334cfcc80 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -27,23 +27,23 @@ {{ statusUsername }} -
+
@@ -238,9 +238,9 @@ export default { props: ['status-id', 'status-username', 'status-template', 'status-url', 'status-profile-url', 'status-avatar'], data() { return { - status: {}, + status: false, media: {}, - user: {}, + user: false, reactions: { liked: false, shared: false @@ -517,14 +517,28 @@ export default { } axios.post('/i/delete', { type: 'status', - item: status.id + item: this.status.id }).then(res => { swal('Success', 'You have successfully deleted this post', 'success'); + window.location.href = '/'; }).catch(err => { swal('Error', 'Something went wrong. Please try again later.', 'error'); }); } + }, + + owner() { + return this.user.id === this.status.account.id; + }, + + admin() { + return this.user.is_admin == true; + }, + + ownerOrAdmin() { + return this.owner() || this.admin(); } - } + + }, }