meme: add confirm to deletion button

This commit is contained in:
Chris Sexton 2021-01-11 17:25:31 -05:00 committed by Chris Sexton
parent 33372ed770
commit ba47710b46
1 changed files with 8 additions and 6 deletions

View File

@ -200,12 +200,14 @@ var memeIndex = `
evt.preventDefault();
evt.stopPropagation();
}
axios.delete('/meme/rm', { data: this.editConfig })
.then(resp => {
this.editConfig = null;
this.refresh();
})
.catch(err => this.err = err);
if (confirm("Are you sure you want to delete this meme?")) {
axios.delete('/meme/rm', { data: this.editConfig })
.then(resp => {
this.editConfig = null;
this.refresh();
})
.catch(err => this.err = err);
}
}
}
})