From a9c393f02a6e3cb165c6a7d3359188bb3c0899d1 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 29 Feb 2024 17:05:45 +0100 Subject: [PATCH] [Fix] Implemented to JSON for notifications --- .../java/li/strolch/rest/endpoint/NotificationResource.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web-rest/src/main/java/li/strolch/rest/endpoint/NotificationResource.java b/web-rest/src/main/java/li/strolch/rest/endpoint/NotificationResource.java index 3630bb1d8..96292769a 100644 --- a/web-rest/src/main/java/li/strolch/rest/endpoint/NotificationResource.java +++ b/web-rest/src/main/java/li/strolch/rest/endpoint/NotificationResource.java @@ -118,7 +118,11 @@ public class NotificationResource { public Response getAllNotifications(@Context HttpServletRequest request) { Certificate cert = validateCertificate(request, PRIVILEGE_GET_NOTIFICATIONS_ALL); try (StrolchTransaction tx = openTx(cert)) { - StrolchRootElementToJsonVisitor visitor = new StrolchRootElementToJsonVisitor().flatBags(); + StrolchRootElementToJsonVisitor visitor = new StrolchRootElementToJsonVisitor() + .withoutPolicies() + .withoutVersion() + .withoutStateVariables() + .flatBagsByType(TYPE_TEXT, TYPE_VISIBILITY); return toResponse(DATA, tx.streamResources(TYPE_NOTIFICATION).map(a -> a.accept(visitor)).toList()); } catch (Exception e) { logger.error(e.getMessage(), e);