working on usability

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-04-03 01:22:26 +02:00
parent a933ced8d8
commit 3d840b9f8a
6 changed files with 57 additions and 23 deletions

View File

@@ -555,7 +555,7 @@ public class UserModule extends BaseHandler implements UserService {
var requestingUser = loadUser(ex);
if (!(requestingUser.isPresent() && requestingUser.get() instanceof DbUser dbUser)) return unauthorized(ex);
var key = body(ex);
return sendContent(ex,mapValues(users.search(key)));
return sendContent(ex,mapValues(search(key)));
}
@Override
@@ -576,6 +576,11 @@ public class UserModule extends BaseHandler implements UserService {
return score;
}
@Override
public Map<Long, ? extends UmbrellaUser> search(String key) {
return users.search(key);
}
private boolean update(HttpExchange ex, DbUser user, JSONObject json) throws UmbrellaException, IOException {
var id = user.id();
var name = json.has(NAME) && json.get(NAME) instanceof String s && !s.isBlank() ? s : user.name();