This repository was archived by the owner on Apr 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ export class OrganizationController {
300300 await getOrganizationMembershipsForUser (
301301 res . locals . token . id ,
302302 organizationId ,
303- req . params . start
303+ req . query . start
304304 )
305305 ) ;
306306 }
Original file line number Diff line number Diff line change @@ -21,9 +21,19 @@ export const getPaginatedData = async (
2121 } ORDER BY ${ primaryKey } ASC LIMIT ${ itemsPerPage } `,
2222 [ index , ...( conditions ? Object . values ( conditions ) : [ ] ) ]
2323 ) ) as any [ ] ;
24+ console . log (
25+ `SELECT * FROM \`${ table } \` WHERE ${ primaryKey } > ? ${
26+ conditions
27+ ? `AND ${ Object . keys ( conditions )
28+ . map ( condition => `${ condition } = ?` )
29+ . join ( " AND " ) } `
30+ : ""
31+ } ORDER BY ${ primaryKey } ASC LIMIT ${ itemsPerPage } `,
32+ [ index , ...( conditions ? Object . values ( conditions ) : [ ] ) ]
33+ ) ;
2434 return {
2535 data,
26- has_more : data . length === itemsPerPage ,
36+ hasMore : data . length === itemsPerPage ,
2737 next : data . length && data [ data . length - 1 ] [ primaryKey ]
2838 } ;
2939} ;
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ export const getOrganizationMemberDetails = async (
176176 { organizationId } ,
177177 start
178178 ) ;
179- for await ( const member of members ) {
179+ for await ( const member of members . data ) {
180180 member . user = await getUser ( member . userId ) ;
181181 }
182182 return members ;
You can’t perform that action at this time.
0 commit comments