diff --git a/lib/inventree/notification.dart b/lib/inventree/notification.dart index c6b74049..a533319b 100644 --- a/lib/inventree/notification.dart +++ b/lib/inventree/notification.dart @@ -42,10 +42,12 @@ class InvenTreeNotification extends InvenTreeModel { */ Future dismiss() async { - await api.post( - "${url}read/", - ); - + if (api.apiVersion >= 82) { + // "Modern" API endpoint operates a little differently + await update(values: {"read": "true"}); + } else { + await api.post("${url}read/"); + } } } \ No newline at end of file diff --git a/lib/widget/notifications.dart b/lib/widget/notifications.dart index 0af32b8b..23b8bd65 100644 --- a/lib/widget/notifications.dart +++ b/lib/widget/notifications.dart @@ -43,6 +43,9 @@ class _NotificationState extends RefreshableState { } } + /* + * Dismiss an individual notification entry (mark it as "read") + */ Future dismissNotification(BuildContext context, InvenTreeNotification notification) async { await notification.dismiss(); @@ -51,6 +54,9 @@ class _NotificationState extends RefreshableState { } + /* + * Display an individual notification message + */ List renderNotifications(BuildContext context) { List tiles = [];