doortts doortts 2018-07-27
api: Change user issue list ordering
@743683a4b624dc052c86fce3d71071ac1663937f
app/controllers/api/UserApi.java
--- app/controllers/api/UserApi.java
+++ app/controllers/api/UserApi.java
@@ -118,9 +118,9 @@
         }
 
         String token = request().getHeader("Authorization").split(AUTHORIZATION_HEADER_PREFIX)[1].replaceAll("\\s", "");
-        User user = getAuthorizedUser(token);
+        User user = User.findByUserToken(token);
 
-        models.support.IssueSearchCondition issueSearchCondition = new IssueSearchCondition();
+        IssueSearchCondition issueSearchCondition = new IssueSearchCondition();
         issueSearchCondition.pageNum = page - 1;
         ExpressionList<Issue> el = issueSearchCondition.getExpressionListByFilter(IssueFilterType.getValue(filter), user);
         Page<Issue> issues = el.findPagingList(pageNum).getPage(issueSearchCondition.pageNum);
app/models/support/IssueSearchCondition.java
--- app/models/support/IssueSearchCondition.java
+++ app/models/support/IssueSearchCondition.java
@@ -51,7 +51,7 @@
         setMentionedIssuesIfExist(el);
         setFavoriteIssuesIfExist(el);
 
-        el.orderBy("id");
+        el.orderBy("updatedDate desc");
         return el;
     }
 
@@ -67,7 +67,7 @@
         junction.add(Expr.in("id", favoriteIssueIdsids));
         junction.endJunction();
 
-        el.orderBy("id");
+        el.orderBy("updatedDate desc");
         return el;
     }
 
Add a comment
List