implemented references to locations

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-11-16 23:13:10 +01:00
parent 97ee1e4aad
commit a4488a2fae
3 changed files with 16 additions and 7 deletions

View File

@@ -300,7 +300,7 @@ public class SqliteDb extends BaseDb implements StockDb {
var current = new HashMap<String,Object>();
current.put(NAME,parent.name());
current.put(ID,parent.id());
current.put(PATH,root);
current.put(LOCATIONS,List.of(root));
root = current;
location = parent;
}

View File

@@ -166,7 +166,7 @@ public class StockModule extends BaseHandler implements StockService {
case null, default -> throw unprocessable("Unprocessable owner type: {0}",owner.type());
};
var pathToLocation = stockDb.pathToLocation(location);
return sendContent(ex,Map.of(ITEMS,items,USERS,userIds,PATH,pathToLocation));
return sendContent(ex,Map.of(ITEMS,items,USERS,userIds,PATH,pathToLocation,LOCATION,location.resolve().toMap()));
}
private boolean getLocations(Path path, UmbrellaUser user, HttpExchange ex) throws IOException {