diff --git a/views/layout_footer.php b/views/layout_footer.php index 144b561..8992dd6 100644 --- a/views/layout_footer.php +++ b/views/layout_footer.php @@ -235,8 +235,7 @@ } function loadNotifications() { - return fetch('/api/notifications.php', { credentials: 'same-origin' }) - .then(function(r) { return r.json(); }) + return lt.api.get('/api/notifications.php') .then(function(data) { renderNotifications(data); return true; }) .catch(function() { list.innerHTML = '
Could not load
'; @@ -251,11 +250,7 @@ if (clearBtn) { clearBtn.addEventListener('click', function() { - fetch('/api/notifications.php', { - method: 'POST', credentials: 'same-origin', - headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': window.CSRF_TOKEN || '' }, - body: JSON.stringify({ action: 'mark_read' }) - }).then(loadNotifications); + lt.api.post('/api/notifications.php', { action: 'mark_read' }).then(loadNotifications); }); }