gocodebox / lifterlms-rest

LifterLMS REST API Feature Plugin
6 stars 7 forks source link

In the get enrollments for student API call I think there is an error where the pages available is greater than the actual pages for the paginated call. Happens when the page size is equal to the enrolments. #305

Open robbiefarai opened 1 year ago

robbiefarai commented 1 year ago

Reproduction Steps

Expected Behavior

Actual Behavior

Error Messages / Logs


### System and Environment Information

<details>
<summary>System Report</summary>

<!-- Paste your System Report between the three backticks below this line -->


</details>

This issue has be recreated:
+ [ ] Locally
+ [ ] On a staging site
+ [ ] On a production website
+ [ ] With only LifterLMS and a default theme

### Browser, Device, and Operating System Information

+ Browser name and version
+ Operating System name and version
+ Device name and version (if applicable)
eri-trabiccolo commented 1 year ago

Hi @robbiefarai thanks for reporting this. I'm not sure I got the issue. I tried retrieving the enrollments of a user who has 6 enrollments, via: wp-json/llms/v1/students/1/enrollments?per_page=6 I got the correct response, with:

X-WP-Total: 6
X-WP-TotalPages: 1

Can you please give us some more information on how to reproduce the issue, and what's the issue about? I mean, what do you expect to happen and what happens instead?

Many thanks!

robbiefarai commented 1 year ago

Sorry for the late response. Our API programmer reported it. We just implemented checks on our end to make sure it doesn't crash our code on our side. All I remembered was that we had 100 posts and page size 100. I will ask him he he can reproduce again.