Fix limit issues
This commit is contained in:
parent
3cf96c589c
commit
d811b9527f
|
@ -263,13 +263,17 @@ export async function paginatedUsers({
|
|||
userList = await bulkGetGlobalUsersById(query?.oneOf?._id, {
|
||||
cleanup: true,
|
||||
})
|
||||
} else if (query) {
|
||||
// TODO: this should use SQS search, but the logic is built in the 'server' package. Using the in-memory filtering to get this working meanwhile
|
||||
const response = await db.allDocs<User>(
|
||||
getGlobalUserParams(null, { ...opts, limit: undefined })
|
||||
)
|
||||
userList = response.rows.map(row => row.doc!)
|
||||
userList = dataFilters.search(userList, { query, limit: opts.limit }).rows
|
||||
} else {
|
||||
// no search, query allDocs
|
||||
const response = await db.allDocs<User>(getGlobalUserParams(null, opts))
|
||||
userList = response.rows.map(row => row.doc!)
|
||||
|
||||
if (query) {
|
||||
userList = dataFilters.search(userList, { query }).rows
|
||||
}
|
||||
}
|
||||
return pagination(userList, pageSize, {
|
||||
paginate: true,
|
||||
|
|
Loading…
Reference in New Issue