mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-25 22:10:47 +00:00
Add confirmation check to post deletion function
This commit is contained in:
parent
1d07c4a72e
commit
ebbe842416
1 changed files with 24 additions and 21 deletions
|
@ -495,18 +495,21 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
deletePost() {
|
deletePost() {
|
||||||
if($('body').hasClass('loggedIn') == false) {
|
var result = confirm('Are you sure you want to delete this post?');
|
||||||
return;
|
if (result) {
|
||||||
}
|
if($('body').hasClass('loggedIn') == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
axios.post('/i/delete', {
|
axios.post('/i/delete', {
|
||||||
type: 'status',
|
type: 'status',
|
||||||
item: this.status.id
|
item: this.status.id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
swal('Success', 'You have successfully deleted this post', 'success');
|
swal('Success', 'You have successfully deleted this post', 'success');
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue