Update /staff for Ariel (new schhema)

This commit is contained in:
Colin McDonald 2016-08-02 19:16:21 -04:00
parent 7f10888151
commit 23a6739eb1

View File

@ -21,18 +21,18 @@ public final class GETStaff implements Handler<RoutingContext> {
}
});
Map<String, Set<User>> result = new TreeMap<>((first, second) -> {
Rank firstRank = staffRanks.get(first);
Rank secondRank = staffRanks.get(second);
Map<String, Set<User>> result = new TreeMap<>((a, b) -> {
Rank aRank = staffRanks.get(a);
Rank bRank = staffRanks.get(b);
return Integer.compare(firstRank.getGeneralWeight(), secondRank.getGeneralWeight());
return Integer.compare(bRank.getGeneralWeight(), aRank.getGeneralWeight());
});
List<Grant> staffGrants = SyncUtils.runBlocking(v -> Grant.findByRank(staffRanks.values(), v));
for (Grant staffGrant : staffGrants) {
if (staffGrant.isActive()) {
User user = SyncUtils.runBlocking(v -> User.findById(staffGrant.getId(), v));
User user = SyncUtils.runBlocking(v -> User.findById(staffGrant.getUser(), v));
Rank rank = staffRanks.get(staffGrant.getRank());
if (!result.containsKey(rank.getId())) {