diff --git a/src/main/java/net/frozenorb/apiv3/route/users/GETStaff.java b/src/main/java/net/frozenorb/apiv3/route/users/GETStaff.java index d64a87d..7b739d9 100644 --- a/src/main/java/net/frozenorb/apiv3/route/users/GETStaff.java +++ b/src/main/java/net/frozenorb/apiv3/route/users/GETStaff.java @@ -21,7 +21,7 @@ public final class GETStaff implements Handler { } }); - Map> result = new TreeMap<>((a, b) -> { + Map> result = new TreeMap<>((a, b) -> { Rank aRank = staffRanks.get(a); Rank bRank = staffRanks.get(b); @@ -29,6 +29,7 @@ public final class GETStaff implements Handler { }); List staffGrants = SyncUtils.runBlocking(v -> Grant.findByRank(staffRanks.values(), v)); + staffGrants.sort((a, b) -> a.getAddedAt().compareTo(b.getAddedAt())); for (Grant staffGrant : staffGrants) { if (staffGrant.isActive()) { @@ -36,7 +37,7 @@ public final class GETStaff implements Handler { Rank rank = staffRanks.get(staffGrant.getRank()); if (!result.containsKey(rank.getId())) { - result.put(rank.getId(), new HashSet<>()); + result.put(rank.getId(), new ArrayList<>()); } result.get(rank.getId()).add(user);