Skip to content
Snippets Groups Projects

Paginate users query result

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