[Fix] Implemented to JSON for notifications

This commit is contained in:
Robert von Burg 2024-02-29 17:05:45 +01:00
parent 22359e51d8
commit a9c393f02a
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 5 additions and 1 deletions

View File

@ -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);