macadmins / simpleMDMpy

python lib for simpleMDM API
MIT License
17 stars 15 forks source link

Fix pagination #58

Closed jcfrt closed 1 year ago

jcfrt commented 1 year ago

Using a mutable object as a default parameter leads to reusing the same object in subsequent calls to the method. For example, the pagination token "starting_after" would be reused from a previous unrelated call, leading to unexpected data being returned.

Fixes #57

jcfrt commented 1 year ago

I also just fixed the fact that requests did not include the "limit" parameter, and items were being fetched one by one, instead of batches of 100.

MagerValp commented 1 year ago

Came here to merge my fix and found this 😀 Merging my branch in #59 instead, hope you don't mind, we'd essentially fixed it the same way.

jcfrt commented 1 year ago

Yep no worries! Thanks for the fix!