From a4810340e53453e97106a998325af50243a7ab0d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 28 Jun 2018 12:06:43 +0300 Subject: api: do not return 404 for empty feeds --- juick-server/src/main/java/com/juick/server/api/Messages.java | 6 +----- juick-server/src/main/java/com/juick/server/api/PM.java | 9 +++------ 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'juick-server/src/main/java/com') diff --git a/juick-server/src/main/java/com/juick/server/api/Messages.java b/juick-server/src/main/java/com/juick/server/api/Messages.java index 36d3e1dd..69cf828c 100644 --- a/juick-server/src/main/java/com/juick/server/api/Messages.java +++ b/juick-server/src/main/java/com/juick/server/api/Messages.java @@ -75,11 +75,7 @@ public class Messages { if (!visitor.isAnonymous()) { int vuid = visitor.getUid(); List mids = messagesService.getMyFeed(vuid, before_mid, true); - - if (!mids.isEmpty()) - return ResponseEntity.ok(messagesService.getMessages(mids)); - - return NOT_FOUND; + return ResponseEntity.ok(messagesService.getMessages(mids)); } return FORBIDDEN; } diff --git a/juick-server/src/main/java/com/juick/server/api/PM.java b/juick-server/src/main/java/com/juick/server/api/PM.java index 045d465e..cbd70bed 100644 --- a/juick-server/src/main/java/com/juick/server/api/PM.java +++ b/juick-server/src/main/java/com/juick/server/api/PM.java @@ -113,11 +113,8 @@ public class PM { } List lastconv = pmQueriesService.getPMLastConversationsUsers(visitor.getUid(), cnt); - if (lastconv != null && !lastconv.isEmpty()) { - PrivateChats pms = new PrivateChats(); - pms.setUsers(lastconv); - return pms; - } - throw new HttpNotFoundException(); + PrivateChats pms = new PrivateChats(); + pms.setUsers(lastconv); + return pms; } } -- cgit v1.2.3