working on new location creation

This commit is contained in:
2025-10-17 15:58:29 +02:00
parent e920e26655
commit 2eb2bb25aa
3 changed files with 39 additions and 7 deletions

View File

@@ -136,7 +136,7 @@ public class StockModule extends BaseHandler implements StockService {
var result = new ArrayList<Object>();
var userLocations = stockDb.listUserLocations(user);
result.add(Map.of(
ID, user.id(),
USER, user.id(),
NAME,user.name(),
LOCATIONS,userLocations.stream().map(DbLocation::toMap).toList()));
@@ -144,7 +144,7 @@ public class StockModule extends BaseHandler implements StockService {
companies.values().stream().sorted(comparing(a -> a.name().toLowerCase())).forEach(company -> {
var locations = stockDb.listCompanyLocations(company);
result.add(Map.of(
ID, company.id(),
COMPANY, company.id(),
NAME,company.name(),
LOCATIONS,locations.stream().sorted(comparing(a -> a.name().toLowerCase())).map(DbLocation::toMap).toList()));