File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,10 @@ async function searchGroups(criteria, isAdmin = false) {
29
29
const session = helper . createDBSession ( )
30
30
try {
31
31
let matchClause
32
+
32
33
if ( criteria . memberId ) {
33
34
matchClause = `MATCH (g:Group)-[r:GroupContains {type: "${ criteria . membershipType } "}]->(o {id: "${ criteria . memberId } "})`
34
- } else {
35
- matchClause = `MATCH (g:Group)`
36
- }
37
-
38
- if ( criteria . universalUID ) {
35
+ } else if ( criteria . universalUID ) {
39
36
matchClause = `MATCH (g:Group)-[r:GroupContains {type: "${ criteria . membershipType } "}]->(o {universalUID: "${ criteria . universalUID } "})`
40
37
} else {
41
38
matchClause = `MATCH (g:Group)`
@@ -104,6 +101,9 @@ async function searchGroups(criteria, isAdmin = false) {
104
101
const totalRes = await session . run ( `${ matchClause } ${ whereClause } RETURN COUNT(g)` )
105
102
const total = totalRes . records [ 0 ] . get ( 0 ) . low || 0
106
103
104
+ console . log ( `${ matchClause } ${ whereClause } RETURN g ORDER BY g.oldId SKIP ${ ( criteria . page - 1 ) * criteria . perPage }
105
+ LIMIT ${ criteria . perPage } ` )
106
+
107
107
// query page of records
108
108
let result = [ ]
109
109
if ( criteria . page <= Math . ceil ( total / criteria . perPage ) ) {
You can’t perform that action at this time.
0 commit comments