diff options
author | Vitaly Takmazov | 2018-06-28 12:06:43 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-06-28 12:06:43 +0300 |
commit | a4810340e53453e97106a998325af50243a7ab0d (patch) | |
tree | bdcd3babd551b91d086eea87c87c5afd68cb1cd4 /juick-server | |
parent | 0f0df74a6a0b069eabbf788d754389ee4c396f84 (diff) |
api: do not return 404 for empty feeds
Diffstat (limited to 'juick-server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/Messages.java | 6 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/PM.java | 9 |
2 files changed, 4 insertions, 11 deletions
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<Integer> 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<User> 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; } } |