Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManagementClient.organizations.getAll returns total as undefined with parameter include_totals set to true #1078

Open
5 tasks done
timrodz-tb opened this issue Jan 28, 2025 · 0 comments
Labels
bug This points to a verified bug in the code

Comments

@timrodz-tb
Copy link

Checklist

  • I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

When I want to grab organizations using getAll with pagination (page, take, include_totals), the resulting total field comes back as undefined.

Scenario: 4 organizations, expected results: total is 4

Current results: total is undefined:

  • page: 1, take: 2, include_totals: true -> total is undefined
  • page: 1, take: 4, include_totals: true -> total is undefined
  • page: 1, take: 10, include_totals: true -> total is undefined

Method in discussion: https://github.com/auth0/node-auth0/blob/master/src/management/__generated/managers/organizations-manager.ts#L648

Reproduction

import { ManagementClient } from 'auth0';

// API keys
export const auth0ManagementClient = new ManagementClient({ ...<api_keys> });

const { data } = await auth0ManagementClient.organizations.getAll({
  page: 1,
  take: 10,
  include_totals: true
});

/**
 * organizations -> [
 *   {
 *     id: '123',
 *     name: 'test',
 *     display_name: 'test',
 *   },
 *   ...
 * ]
 * totals -> undefined
 */

Additional context

No response

node-auth0 version

4.16.0

Node.js version

20.12.0

@timrodz-tb timrodz-tb added the bug This points to a verified bug in the code label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

1 participant