[VoteManager] Add confirmation to locking / deleting votes (#841)

This commit is contained in:
Cinder 2025-01-20 07:41:28 -08:00 committed by GitHub
parent 1480cfb42f
commit 8b992f8e7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,8 @@ class VoteManager {
lockVotes () {
const votes = this.selectedVotes();
if (!votes.length) return;
if (!confirm(`Are you sure that you want to lock ${votes.length} votes?`)) return;
$.ajax({
url: `/${this._type}_votes/lock.json`,
method: "post",
@ -63,6 +65,8 @@ class VoteManager {
deleteVotes () {
const votes = this.selectedVotes();
if (!votes.length) return;
if (!confirm(`Are you sure that you want to delete ${votes.length} votes?`)) return;
$.ajax({
url: `/${this._type}_votes/delete.json`,
method: "post",