Skip to content

Commit 0311cf3

Browse files
Pierce Chaffinhedgiejo
authored andcommitted
Fixes a slight bug with data flow
1 parent 180aef3 commit 0311cf3

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

pegr/grails-app/controllers/pegr/admin/UserAdminController.groovy

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ class UserAdminController {
1818
def users
1919
def totalCount
2020

21-
// if (groupId) {
22-
// def sort = params.sort ? ("user."+params.sort) : "user.fullName"
23-
// users = UserRoleGroup.createCriteria().list(max: params.max, offset: params.offset, sort: sort, order: params.order) {
24-
// eq("roleGroup.id", groupId)
25-
// }.collect { it.user }
26-
//
27-
// totalCount = UserRoleGroup.where { roleGroup.id == groupId }.count()
28-
// } else {
29-
// def query
30-
// if (affiliationId) {
31-
// query = User.where { affiliation.id == affiliationId }
32-
// } else if (isEnabled != null && isEnabled != "") {
33-
// query = User.where { enabled == isEnabled }
34-
// } else {
35-
// query = User.where{}
36-
// }
37-
// users = query.list(params)
38-
// totalCount = query.count()
39-
// }
21+
if (groupId) {
22+
def sort = params.sort ? ("user."+params.sort) : "user.fullName"
23+
users = UserRoleGroup.createCriteria().list(max: params.max, offset: params.offset, sort: sort, order: params.order) {
24+
eq("roleGroup.id", groupId)
25+
}.collect { it.user }
26+
27+
totalCount = UserRoleGroup.where { roleGroup.id == groupId }.count()
28+
} else {
29+
def query
30+
if (affiliationId) {
31+
query = User.where { affiliation.id == affiliationId }
32+
} else if (isEnabled != null && isEnabled != "") {
33+
query = User.where { enabled == isEnabled }
34+
} else {
35+
query = User.where{}
36+
}
37+
users = query.list(params)
38+
totalCount = query.count()
39+
}
4040

4141
[users: users,
4242
totalCount: totalCount,

0 commit comments

Comments
 (0)