Skip to content

Commit

Permalink
fix: force offset based pagination in get users (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwwoda authored Oct 25, 2023
1 parent 22b8f8b commit 9bed083
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ class UserModule {
options.limit = flags.limit;
}

if (flags.usemarker) {
options.usemarker = flags.usemarker;
}
//forcing offset based pagination for now. Using filter_term causes infinite loop because next_marker is never null
// if (flags.usemarker) {
// options.usemarker = flags.usemarker;
// }

if (flags.filter) {
options.filter_term = flags.filter;
Expand Down
6 changes: 2 additions & 4 deletions test/commands/users.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,12 @@ describe('Users', () => {
test
.nock(TEST_API_ROOT, api => api
.get('/2.0/users')
.query({ filter_term: 'AppUser_', usemarker: true, limit: 1000 })
.query({ filter_term: 'AppUser_', limit: 1000 })
.reply(200, fixture)
.get('/2.0/users')
.query({
filter_term: 'AppUser_',
offset: 3,
usemarker: true,
limit: 1000,
})
.reply(200, fixture2)
Expand All @@ -241,13 +240,12 @@ describe('Users', () => {
test
.nock(TEST_API_ROOT, api => api
.get('/2.0/users')
.query({fields: 'name,address', usemarker: true, limit: 1000})
.query({fields: 'name,address', limit: 1000})
.reply(200, fixture)
.get('/2.0/users')
.query({
fields: 'name,address',
offset: 3,
usemarker: true,
limit: 1000
})
.reply(200, fixture2)
Expand Down

0 comments on commit 9bed083

Please sign in to comment.