Skip to content

Commit 7f6af58

Browse files
author
Adam Collins
committed
fix for LookupController
1 parent 0147542 commit 7f6af58

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

grails-app/controllers/au/org/ala/collectory/LookupController.groovy

+6-6
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ class LookupController {
146146
if (pg) {
147147
if (pg.uid[0..1] == 'co') {
148148
render collectionService.buildSummary(pg) as JSON
149-
} else if (pg[0..1] == 'in') {
149+
} else if (pg.uid[0..1] == 'in') {
150150
render institutionService.buildSummary(pg) as JSON
151-
} else if (pg[0..1] == 'dr') {
151+
} else if (pg.uid[0..1] == 'dr') {
152152
render dataResourceService.buildSummary(pg) as JSON
153153
} else {
154154
render pg.buildSummary() as JSON
@@ -164,9 +164,9 @@ class LookupController {
164164
domain.list().each {
165165
if (it.uid[0..1] == 'co') {
166166
list << collectionService.buildSummary(it)
167-
} else if (pg[0..1] == 'in') {
167+
} else if (it.uid[0..1] == 'in') {
168168
list << institutionService.buildSummary(it)
169-
} else if (pg[0..1] == 'dr') {
169+
} else if (it.uid[0..1] == 'dr') {
170170
list << dataResourceService.buildSummary(it)
171171
} else {
172172
list << it.buildSummary()
@@ -235,9 +235,9 @@ class LookupController {
235235
if (instance) {
236236
if (instance.uid[0..1] == 'co') {
237237
render collectionService.buildSummary(instance) as JSON
238-
} else if (pg[0..1] == 'in') {
238+
} else if (instance.uid[0..1] == 'in') {
239239
render institutionService.buildSummary(instance) as JSON
240-
} else if (pg[0..1] == 'dr') {
240+
} else if (instance.uid[0..1] == 'dr') {
241241
render dataResourceService.buildSummary(instance) as JSON
242242
} else {
243243
render instance.buildSummary() as JSON

0 commit comments

Comments
 (0)