woocommerce / pinterest-for-woocommerce

A native Pinterest integration for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/pinterest-for-woocommerce/
GNU General Public License v3.0
22 stars 9 forks source link

Issues table pagination does not respect the page number and page size, and always return all issues #936

Closed ecgan closed 1 month ago

ecgan commented 6 months ago

Describe the bug:

Related to issue https://github.com/woocommerce/pinterest-for-woocommerce/issues/882.

In the Issues table, I have pagination in the table footer like this:

image

There are issues with the pagination:

Here's a screenshot of the API call:

image

From the client side, we pass paged and per_page parameters to the API.

However, on the server side, those parameters are not really used:

https://github.com/woocommerce/pinterest-for-woocommerce/blob/8251408b26fc5838f76b76518e2942efea8efa84/src/API/FeedIssues.php#L39-L74

Specifically, in the following line, we set the limit to be 250, instead of the per_page value:

https://github.com/woocommerce/pinterest-for-woocommerce/blob/8251408b26fc5838f76b76518e2942efea8efa84/src/API/FeedIssues.php#L59

I believe the above is the cause of issue.

Steps to reproduce:

  1. Go to Issues table in the Catalog page.
  2. Test pagination in the Issues table footer.

Expected behavior:

Pagination should work as expected.

Actual behavior:

The table will always show all data, regardless of how you set pagination.