applied some sorting
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>org.example</groupId>
|
<groupId>org.example</groupId>
|
||||||
<artifactId>Widerhall</artifactId>
|
<artifactId>Widerhall</artifactId>
|
||||||
<version>0.2.60</version>
|
<version>0.2.61</version>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ public class User {
|
|||||||
if (emails != null) query.where(EMAIL,emails);
|
if (emails != null) query.where(EMAIL,emails);
|
||||||
var rs = query.compile().exec();
|
var rs = query.compile().exec();
|
||||||
while (rs.next()) userList.add(User.from(rs));
|
while (rs.next()) userList.add(User.from(rs));
|
||||||
|
Collections.sort(userList,(u1,u2)->u1.name.compareTo(u2.name));
|
||||||
return userList;
|
return userList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ public class Rest extends HttpServlet {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LIST_MODERATED:
|
case LIST_MODERATED:
|
||||||
json.put("lists", MailingList.moderatedBy(user).stream().map(MailingList::safeMap).toList());
|
json.put("lists", MailingList.moderatedBy(user).stream().sorted((l1,l2)->l1.name().compareTo(l2.name())).map(MailingList::safeMap).toList());
|
||||||
break;
|
break;
|
||||||
case LIST_SUBSCRIBABLE:
|
case LIST_SUBSCRIBABLE:
|
||||||
json.put("lists", MailingList.subscribable(user).stream().map(MailingList::minimalMap).toList());
|
json.put("lists", MailingList.subscribable(user).stream().map(MailingList::minimalMap).toList());
|
||||||
@@ -348,6 +348,7 @@ public class Rest extends HttpServlet {
|
|||||||
if (!list.membersMayBeListedBy(user)) Map.of(ERROR,t("You are not allowed to list members of '{}'",list.email()));
|
if (!list.membersMayBeListedBy(user)) Map.of(ERROR,t("You are not allowed to list members of '{}'",list.email()));
|
||||||
try {
|
try {
|
||||||
var members = list.members()
|
var members = list.members()
|
||||||
|
.sorted((m1,m2)->m1.user().name().compareTo(m2.user().name()))
|
||||||
.map(ListMember::safeMap)
|
.map(ListMember::safeMap)
|
||||||
.toList();
|
.toList();
|
||||||
return Map.of(MEMBERS,members,LIST,list.minimalMap());
|
return Map.of(MEMBERS,members,LIST,list.minimalMap());
|
||||||
|
|||||||
Reference in New Issue
Block a user