Skip to content
Snippets Groups Projects

Paginate users query result

Merged Grigor Malo requested to merge users-pagination into graphql-api
All threads resolved!
Files
3
@@ -83,7 +83,7 @@ const getUser = async (id, options = {}) => {
const getDisplayName = async user => user.getDisplayName()
const getUsers = async (options = {}) => {
const getUsers = async (queryParams = {}, options = {}) => {
try {
const { trx, ...restOptions } = options
return useTransaction(
@@ -91,7 +91,7 @@ const getUsers = async (options = {}) => {
logger.info(
`${USER_CONTROLLER} getUsers: fetching all users based on provided options ${restOptions}`,
)
return User.find({}, { trx: tr, ...restOptions })
return User.find(queryParams, { trx: tr, ...restOptions })
},
{ trx, passedTrxOnly: true },
)