restructuring

This commit is contained in:
LenAnderson
2023-12-20 15:49:27 +00:00
parent 34decf1c05
commit 2648b3c801
9 changed files with 338 additions and 184 deletions

View File

@ -189,4 +189,20 @@ export class QuickReplySet {
warn(`Failed to save Quick Reply Set: ${this.name}`);
}
}
async delete() {
const response = await fetch('/deletequickreply', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify(this),
});
if (response.ok) {
this.unrender();
const idx = QuickReplySet.list.indexOf(this);
QuickReplySet.list.splice(idx, 1);
} else {
warn(`Failed to delete Quick Reply Set: ${this.name}`);
}
}
}