diff options
author | 2024-04-26 18:33:58 +0300 | |
---|---|---|
committer | 2024-04-26 18:33:58 +0300 | |
commit | e00dc41afada45c9cc0cab882d5e67f8d0c980f2 (patch) | |
tree | daf9e4f9de024f51dc3a581f38bf1d34986ce74f /src/main/java/com/juick/www/api | |
parent | 57fae6b2d4e2f94e49a3b809a47ef4abc2a1ef80 (diff) |
"Mark read" buttonmark_read
Diffstat (limited to 'src/main/java/com/juick/www/api')
-rw-r--r-- | src/main/java/com/juick/www/api/Messages.java | 6 |
1 files changed, 6 insertions, 0 deletions
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()) { |