freactoring to get company list work in efficient way
This commit is contained in:
@@ -137,7 +137,6 @@ public class DocumentApi extends BaseHandler {
|
||||
if (user.isEmpty()) return unauthorized(ex);
|
||||
var head = path.pop();
|
||||
return switch (head){
|
||||
case COMPANIES -> getCompanies(ex,user.get(),token.orElse(null));
|
||||
case CONTACTS -> getContacts(ex,user.get(),token.orElse(null));
|
||||
case PATH_TYPES -> getDocTypes(ex);
|
||||
case STATES -> getDocStates(ex);
|
||||
@@ -232,10 +231,6 @@ public class DocumentApi extends BaseHandler {
|
||||
return ok(ex);
|
||||
}
|
||||
|
||||
private boolean getCompanies(HttpExchange ex, UmbrellaUser user, Token token) throws IOException, UmbrellaException {
|
||||
return sendContent(ex,companies.listCompaniesOf(user).stream().map(Company::toMap));
|
||||
}
|
||||
|
||||
private boolean getContacts(HttpExchange ex, UmbrellaUser user, Token token) throws IOException, UmbrellaException {
|
||||
return sendContent(ex,getLegacyContacts(ex,user,token));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user