diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/app.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/app.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js index 7cc7c83..5311403 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js @@ -650,7 +650,9 @@ function App() { // the page navigates, which reads as "the click did nothing". setNotifications(prev => prev.filter(n => n.id !== id)); setUnreadCount(c => Math.max(0, c - 1)); - hubFetch(`/v1/notifications/${id}/read`, { method: 'POST', token: user.token }) + // DELETE, not `/read`: dismissing one drops the row. The old path still + // works and still deletes, for interfaces older than the hub. + hubFetch(`/v1/notifications/${id}`, { method: 'DELETE', token: user.token }) .catch(() => fetchNotifications()); }, [user, fetchNotifications]); @@ -667,8 +669,8 @@ function App() { if (!user) return; setNotifications(prev => { const gone = prev.filter(n => n.group_id === groupId && n.kind === 'group_invite'); - gone.forEach(n => hubFetch(`/v1/notifications/${n.id}/read`, - { method: 'POST', token: user.token }).catch(() => {})); + gone.forEach(n => hubFetch(`/v1/notifications/${n.id}`, + { method: 'DELETE', token: user.token }).catch(() => {})); if (gone.length) setUnreadCount(c => Math.max(0, c - gone.length)); return prev.filter(n => !gone.includes(n)); }); |