@budibase/backend-core 2.11.39 → 2.11.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -8
- package/dist/index.js.map +3 -3
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +6 -6
- package/dist/plugins.js.meta.json +1 -1
- package/dist/src/users/db.d.ts +4 -1
- package/dist/src/users/db.js +4 -4
- package/dist/src/users/db.js.map +1 -1
- package/dist/src/users/users.d.ts +1 -1
- package/dist/src/users/users.js +4 -3
- package/dist/src/users/users.js.map +1 -1
- package/package.json +6 -6
- package/src/users/db.ts +5 -5
- package/src/users/users.ts +6 -3
package/src/users/users.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
SearchUsersRequest,
|
|
20
20
|
User,
|
|
21
21
|
ContextUser,
|
|
22
|
+
DatabaseQueryOpts,
|
|
22
23
|
} from "@budibase/types"
|
|
23
24
|
import { getGlobalDB } from "../context"
|
|
24
25
|
import * as context from "../context"
|
|
@@ -241,12 +242,14 @@ export const paginatedUsers = async ({
|
|
|
241
242
|
bookmark,
|
|
242
243
|
query,
|
|
243
244
|
appId,
|
|
245
|
+
limit,
|
|
244
246
|
}: SearchUsersRequest = {}) => {
|
|
245
247
|
const db = getGlobalDB()
|
|
248
|
+
const pageLimit = limit ? limit + 1 : PAGE_LIMIT + 1
|
|
246
249
|
// get one extra document, to have the next page
|
|
247
|
-
const opts:
|
|
250
|
+
const opts: DatabaseQueryOpts = {
|
|
248
251
|
include_docs: true,
|
|
249
|
-
limit:
|
|
252
|
+
limit: pageLimit,
|
|
250
253
|
}
|
|
251
254
|
// add a startkey if the page was specified (anchor)
|
|
252
255
|
if (bookmark) {
|
|
@@ -269,7 +272,7 @@ export const paginatedUsers = async ({
|
|
|
269
272
|
const response = await db.allDocs(getGlobalUserParams(null, opts))
|
|
270
273
|
userList = response.rows.map((row: any) => row.doc)
|
|
271
274
|
}
|
|
272
|
-
return pagination(userList,
|
|
275
|
+
return pagination(userList, pageLimit, {
|
|
273
276
|
paginate: true,
|
|
274
277
|
property,
|
|
275
278
|
getKey,
|