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

not getting a next link for transactions #19

Open
bentwonk opened this issue Dec 19, 2021 · 9 comments
Open

not getting a next link for transactions #19

bentwonk opened this issue Dec 19, 2021 · 9 comments

Comments

@bentwonk
Copy link
Contributor

await up.transactions.listByAccount("accountID,{pageSize: 10, filterSince:"2020-03-01T12:02:03Z",filterUntil:"2021-11-30T18:02:03Z"});

returns pagesize (10) results, but no next page link.

"links": {
"prev": null
}

could this be related to recent changed to pagination?

@ndench
Copy link
Owner

ndench commented Dec 22, 2021

That's an interesting one @bentwonk. It could very well be related to the recent change in pagination. Are you getting previous and next links for any other API calls or is it broken for all of them?

Maybe @IAmMadfly would be able to shed some more light?

@bentwonk
Copy link
Contributor Author

bentwonk commented Dec 25, 2021 via email

@bentwonk
Copy link
Contributor Author

bentwonk commented Dec 25, 2021 via email

@ndench
Copy link
Owner

ndench commented Dec 31, 2021

Have you tried rolling back to version 1.4 or 1.3? I don't have time to fix it right now. I might be able to look into it in a couple of weeks.

Are you able to get an example json response from the API so we can write some tests for it?

@IAmMadfly
Copy link
Contributor

I might try and write some tests for this library. To check this works. Does it currently use a particular framework?

@ndench
Copy link
Owner

ndench commented Jan 2, 2022

I wrote these tests a while ago: #12
But I'm not set on the framework or approach. Open to some feedback!

@ndench
Copy link
Owner

ndench commented Jan 16, 2022

I've added a CLI command in #21 that you can use to further debug your issue.
Using this, I can confirm that calling up.transactions.list() works correctly for me and returns the next page link. It also works for other endpoints as well:

yarn run up transactions list
yarn run up accounts list --pageSize=5

Maybe you could clone my PR and have a play with the CLI command to see what the issue is.

Also, if someone has any insight into the ramifications of changing the "module" option in tsconfig.json that would be great!

@parth-kulkarni1
Copy link

for anyone wondering, downgrading to version 1.3.0 seems to fix this issue for now. Maybe 1.4.0 could work also.

@IAmMadfly
Copy link
Contributor

I have added tests on my own fork. And it seems to be working for me. Can someone run my tests with their own UpBank api key and maybe see if it is an issue of not having a long enough list to trigger it?

fork: https://github.com/IAmMadfly/up-bank-api

to run test, put your API KEY in the environment variable TEST_UPBANK_KEY

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

4 participants