From bb1c01635e2512054473a728a9c7350a897f02ce Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 27 Nov 2021 22:40:03 +0100 Subject: [PATCH] fix read flag --- .../templates/InvenTree/notifications/notifications.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/InvenTree/notifications/notifications.html b/InvenTree/templates/InvenTree/notifications/notifications.html index e3d30117c6..e8aa6dbf19 100644 --- a/InvenTree/templates/InvenTree/notifications/notifications.html +++ b/InvenTree/templates/InvenTree/notifications/notifications.html @@ -24,6 +24,9 @@ function loadNotificationTable(table, options={}) { + var params = options.params || {}; + var read = typeof(params.read) === 'undefined' ? true : params.read; + $(table).inventreeTable({ url: options.url, name: options.name, @@ -31,9 +34,9 @@ function loadNotificationTable(table, options={}) { search: true, queryParams: { ordering: 'age', + read: read, }, paginationVAlign: 'bottom', - original: options.params, formatNoMatches: options.no_matches, columns: [ { @@ -87,6 +90,9 @@ function loadNotificationTable(table, options={}) { loadNotificationTable("#inbox-table", { name: 'inbox', url: '{% url 'api-notifications-list' %}', + params: { + read: false, + }, no_matches: function() { return '{% trans "No unread notifications found" %}'; }, });