diff --git a/public/js/subscription-manager.js b/public/js/subscription-manager.js index 8e49c05..fad4e56 100644 --- a/public/js/subscription-manager.js +++ b/public/js/subscription-manager.js @@ -100,10 +100,21 @@ const component = () => { return `${key}${type}${value}`; }, - action(event, type) { + actionHandler(event, type) { + const id = $(event.currentTarget).closest("tr").attr("sid"); + if (type !== 'delete') return this.action(id, type); + UIkit.modal.confirm('Are you sure you want to delete the subscription? This cannot be undone.', { + labels: { + ok: 'Yes, delete it', + cancel: 'Cancel' + } + }).then(() => { + this.action(id, type); + }); + }, + action(id, type) { if (this.loading) return; this.loading = true; - const id = $(event.currentTarget).closest("tr").attr("sid"); fetch( `${base_url}api/admin/plugin/subscriptions${type === 'update' ? '/update' : ''}?${new URLSearchParams( { diff --git a/src/views/subscription-manager.html.ecr b/src/views/subscription-manager.html.ecr index 02f04e9..b1b49cd 100644 --- a/src/views/subscription-manager.html.ecr +++ b/src/views/subscription-manager.html.ecr @@ -42,8 +42,8 @@ - - + +