diff --git a/service/grails-app/controllers/org/olf/EntryLookupController.groovy b/service/grails-app/controllers/org/olf/EntryLookupController.groovy index 8e6ab18..63b1565 100644 --- a/service/grails-app/controllers/org/olf/EntryLookupController.groovy +++ b/service/grails-app/controllers/org/olf/EntryLookupController.groovy @@ -13,12 +13,19 @@ class EntryLookupController { String tenant = request.getHeader(OKAPITENANTHEADER); String symbolsString = params.symbols; String type = params.type; //typically "institution" or "branch" + String units = params.units; List result = []; Tenants.withId(tenant.toLowerCase()+'_mod_directory', { List symbolList = symbolsFromString(symbolsString); for (Symbol sym : symbolList) { result.add(sym.owner); + if (units == "yes") { + DirectoryEntry parent = sym.owner; + for (DirectoryEntry unit : parent.units) { + result.add(unit); + } + } } if (type) {