added tests, preparing submission confirmation
This commit is contained in:
@@ -53,7 +53,12 @@ public class Rest extends HttpServlet {
|
||||
json.put(USER,user.safeMap());
|
||||
switch (path) {
|
||||
case USER_LIST:
|
||||
json.put("users", (user.is(ADMIN) ? User.list() : List.of(user)).stream().map(User::safeMap).toList());
|
||||
try {
|
||||
json.put("users", (user.is(ADMIN) ? User.loadAll() : List.of(user)).stream().map(User::safeMap).toList());
|
||||
} catch (SQLException e) {
|
||||
LOG.debug("Failed to load user list:",e);
|
||||
json.put(ERROR,"failed to load user list");
|
||||
}
|
||||
break;
|
||||
case LIST_LIST:
|
||||
json.put("lists", MailingList.listsOf(user).stream().map(MailingList::safeMap).toList());
|
||||
|
||||
Reference in New Issue
Block a user