feat: add resend notification action with push
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user