Yuri-Lima / woocommerce-rest-api-ts-lib

This is some improvements for the oficial WooCommerce repo. https://github.com/woocommerce/woocommerce-rest-api-js-lib I hope they merge or accept it as new repo. soon. Please few free to contact me.
MIT License
28 stars 8 forks source link

Paging does not work! #42

Open constantinosgeorgiou opened 1 year ago

constantinosgeorgiou commented 1 year ago

The way the current client is set up paging gets ignored due to the way the ProductsMainParams is defined.

export type ProductsMainParams = (ProductsParams & ProductsVariationsParams & ProductsAttributesParams) | ProductsAttributesTermsParams | ProductsCategoriesParams | ProductsShippingClassesParams | ProductsTagsParams | ProductsReviewsParams;

The ProductsParams contains the properties page and per_page, but the rest of the params do not.

Since paging works for product variations and product attributes, it is required to work for the rest of the endpoints.

Solution

Create a type intersection with either the ProductsParams type, or create a new type Paging.

constantinosgeorgiou commented 1 year ago

@Yuri-Lima I can create a PR if this issue is assigned to me

Yuri-Lima commented 11 months ago

Hi, @constantinosgeorgiou, sorry for my late answer. Ok, i have done that. Thank you for your support.

matheusdamiao commented 8 months ago

Hi, guys! Was this problem fixed? I'm trying to pass query params in some routes and it's not working.

Yuri-Lima commented 8 months ago

@matheusdamiao hey man. Unfortunately not yet. I out of time at the moment to put my hand on it. If you wanna make that correction i would be glad to merge you PR. 👍