diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 3c19ea51f..6d86dd7a7 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -496,18 +496,21 @@ export default { }, deletePost() { - if($('body').hasClass('loggedIn') == false) { - return; - } + var result = confirm('Are you sure you want to delete this post?'); + if (result) { + if($('body').hasClass('loggedIn') == false) { + return; + } - axios.post('/i/delete', { - type: 'status', - item: this.status.id - }).then(res => { - swal('Success', 'You have successfully deleted this post', 'success'); - }).catch(err => { - swal('Error', 'Something went wrong. Please try again later.', 'error'); - }); + axios.post('/i/delete', { + type: 'status', + item: this.status.id + }).then(res => { + swal('Success', 'You have successfully deleted this post', 'success'); + }).catch(err => { + swal('Error', 'Something went wrong. Please try again later.', 'error'); + }); + } } } }