feat: add resend notification action with push

This commit is contained in:
2026-06-14 10:05:19 -04:00
parent aea0a4d189
commit a25ebdcb75
4 changed files with 65 additions and 5 deletions

View File

@@ -58,3 +58,20 @@ function confirmDelete(id, title) {
})
.catch(() => showToast('error', 'Failed to delete notification'));
}
function confirmResend(id) {
const csrf = document.querySelector('meta[name="csrf-token"]')?.content || '';
fetch('/admin/notifications/' + id + '/resend', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-Token': csrf,
},
body: '_csrf_token=' + encodeURIComponent(csrf),
})
.then(r => r.json())
.then(data => {
showToast(data.success ? 'success' : 'error', data.message);
})
.catch(() => showToast('error', 'Failed to resend notification'));
}