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

Xero-node pagination doesn't work #694

Closed
dungphaminfostatus opened this issue Jul 8, 2024 · 3 comments
Closed

Xero-node pagination doesn't work #694

dungphaminfostatus opened this issue Jul 8, 2024 · 3 comments

Comments

@dungphaminfostatus
Copy link

dungphaminfostatus commented Jul 8, 2024

SDK you're using (please complete the following information):

  • Version 8.0.0

Describe the bug
I'm using xero-node 8.0.0 in my project. Based on the official document, I expected to get "pageInfo" when I passed page and pageSize in but now it's undefined.

To Reproduce
Snippet:
await this.xero.getClientCredentialsToken()
const xeroTenantId = ''
const ifModifiedSince: Date = null
const where = ''
const order = 'InvoiceNumber ASC'
const iDs = []
const invoiceNumbers = []
const contactIDs = [cliId];
const statuses = [Invoice.StatusEnum.AUTHORISED.toString(), Invoice.StatusEnum.PAID.toString()]
const includeArchived = false;
const createdByMyApp = false;
const unitdp = null;
const summaryOnly = false;
const pageSize = limit;
const searchTerm = 'SearchTerm=REF12';
const invoices = await this.xero.accountingApi.getInvoices(
xeroTenantId,
ifModifiedSince,
where,
order,
iDs,
invoiceNumbers,
contactIDs,
statuses,
page,
includeArchived,
createdByMyApp,
unitdp,
summaryOnly,
pageSize
)
console.log(invoices)

Actual result
body: GetInvoicesResponse {
id: '93464360-19c5-4961-ac68-d322e7e6a48e',
status: 'OK',
providerName: 'Csp',
dateTimeUTC: 2024-07-08T10:56:50.022Z,
pageInfo: undefined,
invoices: [ [Invoice], [Invoice], [Invoice] ]
}

Expected behavior
The pageInfo should not be undefined

Copy link

github-actions bot commented Jul 8, 2024

PETOSS-465

Copy link

github-actions bot commented Jul 8, 2024

Thanks for raising an issue, a ticket has been created to track your request

@sangeet-joy-tw
Copy link
Contributor

Hey @dungphaminfostatus ,

In the latest xero-node SDK version the pageInfo field is removed and pagination property has been added instead.

I request you to upgrade your version to latest 9.1.0. and try calling the getInvoices method and ideally you should be seeing pagination data.

For more details on getInvoices API please refer to the developer doc.

Let us know if you face further issues.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants