diff options
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/controllers')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/Messages.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Messages.java b/juick-api/src/main/java/com/juick/api/controllers/Messages.java index 3037f3a1..322effa3 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/Messages.java +++ b/juick-api/src/main/java/com/juick/api/controllers/Messages.java @@ -139,7 +139,10 @@ public class Messages { @RequestParam(required = false) Long before ) { User visitor = UserUtils.getCurrentUser(); - return ResponseEntity.ok(messagesService.getNotifications(visitor, LocalDateTime.ofInstant(Instant.ofEpochMilli(before), ZoneId.systemDefault()))); + LocalDateTime beforeTime = before != null ? + LocalDateTime.ofInstant(Instant.ofEpochMilli(before), ZoneId.systemDefault()) + : null; + return ResponseEntity.ok(messagesService.getNotifications(visitor, beforeTime)); } @RequestMapping("/thread") public ResponseEntity<List<com.juick.Message>> getThread( |