fix read flag

This commit is contained in:
Matthias 2021-11-27 22:40:03 +01:00
parent e01f2e202e
commit bb1c01635e
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -24,6 +24,9 @@
function loadNotificationTable(table, options={}) { function loadNotificationTable(table, options={}) {
var params = options.params || {};
var read = typeof(params.read) === 'undefined' ? true : params.read;
$(table).inventreeTable({ $(table).inventreeTable({
url: options.url, url: options.url,
name: options.name, name: options.name,
@ -31,9 +34,9 @@ function loadNotificationTable(table, options={}) {
search: true, search: true,
queryParams: { queryParams: {
ordering: 'age', ordering: 'age',
read: read,
}, },
paginationVAlign: 'bottom', paginationVAlign: 'bottom',
original: options.params,
formatNoMatches: options.no_matches, formatNoMatches: options.no_matches,
columns: [ columns: [
{ {
@ -87,6 +90,9 @@ function loadNotificationTable(table, options={}) {
loadNotificationTable("#inbox-table", { loadNotificationTable("#inbox-table", {
name: 'inbox', name: 'inbox',
url: '{% url 'api-notifications-list' %}', url: '{% url 'api-notifications-list' %}',
params: {
read: false,
},
no_matches: function() { return '{% trans "No unread notifications found" %}'; }, no_matches: function() { return '{% trans "No unread notifications found" %}'; },
}); });