MCPcopy Index your code
hub / github.com/Dispatcharr/Dispatcharr / getNotifications

Method getNotifications

frontend/src/api.js:3679–3698  ·  view source on GitHub ↗

* Get all active notifications for the current user * @param {boolean} includeDismissed - Whether to include already dismissed notifications

(includeDismissed = false)

Source from the content-addressed store, hash-verified

3677 * @param {boolean} includeDismissed - Whether to include already dismissed notifications
3678 */
3679 static async getNotifications(includeDismissed = false) {
3680 try {
3681 const params = new URLSearchParams();
3682 if (includeDismissed) {
3683 params.append('include_dismissed', 'true');
3684 }
3685 const response = await request(
3686 `${host}/api/core/notifications/?${params.toString()}`
3687 );
3688
3689 // Update the store with fetched notifications
3690 const { default: useNotificationsStore } =
3691 await import('./store/notifications');
3692 useNotificationsStore.getState().setNotifications(response.notifications);
3693
3694 return response;
3695 } catch (e) {
3696 errorNotification('Failed to retrieve notifications', e);
3697 }
3698 }
3699
3700 // Get unread notification count
3701 static async getNotificationCount() {

Callers 3

WebsocketProviderFunction · 0.80
getNotificationsFunction · 0.80

Calls 2

requestFunction · 0.85
errorNotificationFunction · 0.85

Tested by

no test coverage detected