dev add context for notifcations
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-13 14:27:01 +07:00
parent a6e73be032
commit b77efcbce5
2 changed files with 12 additions and 2 deletions
@@ -153,13 +153,23 @@ public class NotificationHandler implements RequestHandler {
}
private NotificationDto toDto(Notification notification) {
Object contextObject = null;
if (notification.getContext() != null) {
try {
ObjectMapper objectMapper = new ObjectMapper();
contextObject = objectMapper.readValue(notification.getContext(), Object.class);
} catch (Exception e) {
contextObject = notification.getContext();
}
}
return NotificationDto.builder()
.id(notification.getId())
.message(notification.getMessage())
.type(notification.getNotificationType())
.status(notification.getStatus())
.createdAt(notification.getCreatedAt())
.context(notification.getContext())
.context(contextObject)
.build();
}
}