@@ -281,7 +281,7 @@ export default {
$('head title').text(title);
}
},
-
+
methods: {
authCheck() {
let authed = $('body').hasClass('loggedIn');
@@ -495,19 +495,22 @@ 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');
+ });
+ }
}
}
}
-
\ No newline at end of file
+