From e00dc41afada45c9cc0cab882d5e67f8d0c980f2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 26 Apr 2024 18:33:58 +0300 Subject: "Mark read" button --- src/main/java/com/juick/www/api/Messages.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/com/juick/www/api') diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java index 969bef4f..5a90bf0b 100644 --- a/src/main/java/com/juick/www/api/Messages.java +++ b/src/main/java/com/juick/www/api/Messages.java @@ -210,6 +210,12 @@ public class Messages { } throw new HttpBadRequestException(); } + @PostMapping("/api/messages/mark_read") + public void markRead(@Parameter(hidden = true) User visitor) { + if (!visitor.isAnonymous()) { + messagesService.setAllRead(visitor); + } + } @PostMapping("/api/messages/set_privacy") public void togglePrivacy(@Parameter(hidden = true) User visitor, @RequestParam Integer mid) { if (visitor.isPremium() || visitor.isAdmin()) { -- cgit v1.2.3