Confirm before deleting post

This commit is contained in:
silverpill 2022-06-03 13:10:32 +00:00
parent f1add10c22
commit ff9a4e396a

View file

@ -426,9 +426,11 @@ export default class PostComponent extends Vue {
}
async deletePost() {
const authToken = this.store.ensureAuthToken()
await deletePost(authToken, this.post.id)
this.$emit("post-deleted")
if (confirm("Are you sure you want to delete this post?")) {
const authToken = this.store.ensureAuthToken()
await deletePost(authToken, this.post.id)
this.$emit("post-deleted")
}
}
getPaymentOptions(): PaymentOption[] {